a, b = 1, 1 n = (a + 1) // 2 while n < 10 ** 12: a, b = 3 * a + 4 * b, 2 * a + 3 * b n = (a + 1) // 2 print (b + 1) // 2