import java.util.PriorityQueue;

public class Euler247 {
    static class Node implements Comparable<Node> {
        int left, below;
        double x, y, side;

        Node(int left, int below, double x, double y, double side) {
            this.left = left;
            this.below = below;
            this.x = x;
            this.y = y;
            this.side = side;
        }

        @Override
        public int compareTo(Node other) {
            // Max-heap based on side lengths mapping to highest priority
            return Double.compare(other.side, this.side);
        }
    }

    static double largestSide(double x, double y) {
        return (Math.sqrt((x - y) * (x - y) + 4.0) - (x + y)) / 2.0;
    }

    static long binom(int n, int k) {
        if (k < 0 || k > n)
            return 0;
        if (k == 0 || k == n)
            return 1;
        long numer = 1;
        long denom = 1;
        int kk = Math.min(k, n - k);
        for (int i = 1; i <= kk; ++i) {
            numer *= (n - kk + i);
            denom *= i;
        }
        return numer / denom;
    }

    public static String solve() {
        int targetLeft = 3;
        int targetBelow = 3;

        long targetOccurrences = binom(targetLeft + targetBelow, targetLeft);

        PriorityQueue<Node> pq = new PriorityQueue<>();

        double rootX = 1.0;
        double rootY = 0.0;
        double rootSide = largestSide(rootX, rootY);
        pq.add(new Node(0, 0, rootX, rootY, rootSide));

        long index = 0;
        long seen = 0;
        long answer = 0;

        while (seen < targetOccurrences) {
            Node cur = pq.poll();
            index++;

            if (cur.left == targetLeft && cur.below == targetBelow) {
                seen++;
                answer = index;
            }

            double rightX = cur.x + cur.side;
            double rightY = cur.y;
            double rightSide = largestSide(rightX, rightY);
            pq.add(new Node(cur.left + 1, cur.below, rightX, rightY, rightSide));

            double upX = cur.x;
            double upY = cur.y + cur.side;
            double upSide = largestSide(upX, upY);
            pq.add(new Node(cur.left, cur.below + 1, upX, upY, upSide));
        }

        return String.valueOf(answer);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
