package ru.redguy.tasks;

import ru.redguy.ATask;
import ru.redguy.Task;

import java.io.IOException;


@ATask("16")
public class Task16 extends Task {

    //fn = fn-1 + fn-2
    public int F(int n) {
        if(n<2) return 1;
        if(n % 3 == 0) return F(n/3) - 1;
        return F(n - 1) + 7;
    }

    @Override
    public void run() throws IOException {
        int count = 0;
        for (int i = 1; i < 100001; i++) {
            if(F(i)==35)count++;
        }
        System.out.println(count);
    }
}
