import java.util.*;

public class Euler198 {
    public static void main(String[] args) {
        long qLimit = 100000000L;
        long maxProduct = qLimit / 2;
        long count = 0;
        Deque<long[]> stack = new ArrayDeque<>();
        stack.push(new long[] { 0, 1, 1, 1 });
        while (!stack.isEmpty()) {
            long[] f = stack.pop();
            long a = f[0], b = f[1], c = f[2], d = f[3];
            if (b > maxProduct / d)
                continue;
            if (a * 100 >= b)
                continue;
            // midpoint check: (a*d + b*c)*100 < 2*b*d
            if ((a * d + b * c) * 100 < 2 * b * d)
                count++;
            long mn = a + c, md = b + d;
            stack.push(new long[] { a, b, mn, md });
            stack.push(new long[] { mn, md, c, d });
        }
        System.out.println(count);
    }
}
