You have array a_1, a_2, ..., a_{n}. Segment [l, r] (1 ≤ l ≤ r ≤ n) is good if a_{i} = a_{i} - 1 + a_{i} - 2, for all i (l + 2 ≤ i ≤ r).

Let's define len([l, r]) = r - l + 1, len([l, r]) is the length of the segment [l, r]. Segment [l_1, r_1], is longer than segment [l_2, r_2], if len([l_1, r_1]) > len([l_2, r_2]).

Your task is to find a good segment of the maximum length in array a. Note that a segment of length 1 or 2 is always good.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^5) — the number of elements in the array. The second line contains integers: a_1, a_2, ..., a_{n} (0 ≤ a_{i} ≤ 10^9).


-----Output-----

Print the length of the longest good segment in array a.


-----Examples-----
Input
10
1 2 3 5 8 13 21 34 55 89

Output
10

Input
5
1 1 1 1 1

Output
2

Difficulty: EASY

Solutions:
n = int(input())
a = [int(i) for i in input().split()]
if n <= 2:
	print(n)
	quit()
ma = 2
x = 2
i = 2
while i < n:
	if a[i] == a[i - 1] + a[i - 2]:
		x += 1
	else:
		ma = max(ma, x)
		x = 2
	i += 1
print(max(ma, x))


from sys import stdin, stdout

def main():
	n = int(stdin.readline())
	a = [int(x) for x in stdin.readline().strip().split()]
	d = 2
	ans = -1
	if n <= 2:
		stdout.write(str(n))
		return
	for i in range(2, len(a)):
		if a[i] != a[i - 1] + a[i - 2]:
			d = 2
		else:
			d += 1
		ans = max(ans, d)
	stdout.write(str(ans))
main()


n = int(input())
li = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	count = 0
	maximum = 0
	for i in range(2, n):
		if li[i] == li[i - 1] + li[i - 2]:
			count += 1
		if li[i] != li[i - 1] + li[i - 2]:
			maximum = max(count, maximum)
			count = 0
	maximum = max(count, maximum)
	print(maximum + 2)


import sys
from functools import reduce
from collections import Counter
import time
import datetime
import math

def ip():
	return int(sys.stdin.readline())

def sip():
	return input()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
arr = lip()
count = 2
if n <= 1:
	max_ = 1
elif n >= 2:
	max_ = 2
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		count += 1
	else:
		count = 2
	if max_ < count:
		max_ = count
print(max_)


n = int(input())
lst = list(map(int, input().split()))
if len(lst) < 3:
	maxlen = lenght = len(lst)
else:
	maxlen = lenght = 2
for i in range(2, len(lst)):
	if lst[i] == lst[i - 1] + lst[i - 2]:
		lenght += 1
		if lenght > maxlen:
			maxlen = lenght
	else:
		if lenght > maxlen:
			maxlen = lenght
		lenght = 2
print(maxlen)


n = int(input())
array = list(map(int, input().split()))
ans = 1
count = 0
if n >= 2:
	ans = 2
for i in range(2, n):
	if array[i] == array[i - 1] + array[i - 2]:
		count += 1
	else:
		count = 0
	ans = max(ans, count + 2)
print(ans)


n = int(input())
s = list(map(int, input().split()))
maxx = 2
i = 2
p = 0
w = 2
while i < n:
	if s[i] == s[i - 1] + s[i - 2]:
		w += 1
		i += 1
		p = 1
	else:
		if p == 1:
			if w > maxx:
				maxx = w
		w = 2
		i += 1
		p = 0
if w > maxx:
	maxx = w
if n == 1:
	print('1')
elif n == 2:
	print('2')
else:
	print(maxx)


n = int(input())
arr = list(map(int, input().split()))
maxx = 2
i = 2
while i < n:
	count = 2
	while i < n and arr[i - 1] + arr[i - 2] == arr[i]:
		count += 1
		i += 1
	if count > maxx:
		maxx = count
	i += 1
if n == 1:
	maxx = 1
print(maxx)


n = int(input())
nums = list(map(int, input().split()))
cnt = 0
res = set()
flag = 0
final = set()
for i in range(len(nums)):
	if i - 1 >= 0 and i - 2 >= 0:
		if nums[i] == nums[i - 1] + nums[i - 2]:
			cnt += 1
			continue
		res.add(cnt)
		cnt = 0
res.add(cnt)
final.add(max(max(res) + 2, cnt + 2))
final.add(len(nums))
print(min(final))


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
n = ii()
l = li()
c = n
if c > 2:
	c = m = 2
	for i in range(2, n):
		if l[i] == l[i - 1] + l[i - 2]:
			m += 1
		else:
			c = max(m, c)
			m = 2
	c = max(m, c)
print(c)


n = int(input())
b = [int(x) for x in input().split()]
max = 2
if len(b) <= max:
	max = len(b)
s = 2
for i in range(2, len(b)):
	if b[i] == b[i - 1] + b[i - 2]:
		s += 1
	else:
		s = 2
	if s > max:
		max = s
print(max)


n = int(input())
arr = list(map(int, input().split()))
count = 2
temp = list()
if len(arr) <= 2:
	print(len(arr))
	quit()
for i in range(2, len(arr)):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		count += 1
		if i == len(arr) - 1:
			temp.append(count)
	else:
		temp.append(count)
		count = 2
temp.sort()
print(temp[-1])


n = int(input())
a = list(map(int, input().split()))
l = 2
maxl = 2
for i in range(2, n):
	if a[i] == a[i - 2] + a[i - 1]:
		l += 1
		if l > maxl:
			maxl = l
	else:
		if l > maxl:
			maxl = l
		l = 2
print(min(maxl, n))


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
n = ii()
l = li()
a = []
c = 2
for i in range(len(l)):
	if i <= 1:
		continue
	if l[i] == l[i - 1] + l[i - 2]:
		c += 1
	else:
		a.append(c)
		c = 2
a.append(c)
print(max(a) if len(l) >= 2 else len(a))


n = int(input())
l = list(map(int, input().split()))
(p, c) = (2, 2)
if n == 1:
	print(1)
else:
	for i in range(2, n):
		if l[i] == l[i - 1] + l[i - 2]:
			c += 1
		else:
			p = max(c, p)
			c = 2
	p = max(p, c)
	print(p)


n = int(input())
l = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	(i, m, x) = (0, 0, 2)
	while i < n - 2:
		if l[i] + l[i + 1] == l[i + 2]:
			x += 1
			i += 1
		else:
			m = max(m, x)
			x = 2
			i += 1
	m = max(m, x)
	print(m)


n = int(input())
a = list(map(int, input().split()))

def fn(n, a):
	if n < 3:
		return n
	ans = 0
	temp = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			temp += 1
		else:
			if temp > ans:
				ans = temp
			temp = 2
		ans = max(temp, ans)
	return ans
print(fn(n, a))


n = int(input())
seq = input()
seq = [int(x) for x in seq.split()]
count = 0
best_count = 0
for i in range(n):
	if n <= 2:
		print(n)
		break
	elif i + 3 > n:
		print(best_count + 2)
		break
	elif seq[i + 2] == seq[i] + seq[i + 1]:
		count += 1
		if count > best_count:
			best_count = count
	else:
		count = 0


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import *
(n, a, ans, p) = (int(input()), arr_inp(), 2, 2)
if n <= 2:
	print(n)
else:
	for i in range(2, n):
		if a[i] == sum(a[i - 2:i]):
			p += 1
			ans = max(ans, p)
		else:
			p = 2
	print(ans)


n = int(input())
a = list(map(int, input().rstrip().split()))
if n <= 2:
	print(n)
	exit()
i = 2
j = 0
ma = 2
curr = 2
s = a[0] + a[1]
while i < n:
	if s == a[i]:
		curr += 1
		s += a[i]
		s -= a[i - 2]
	else:
		if curr > ma:
			ma = curr
		curr = 2
		s += a[i]
		s -= a[i - 2]
	i += 1
if curr > ma:
	print(curr)
else:
	print(ma)


n = int(input())
arr = list(map(int, input().split(' ')))

def fibonacci(n, arr):
	if n == 1:
		return 1
	else:
		len = 2
	tmp = 2
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			tmp += 1
		else:
			len = max(len, tmp)
			tmp = 2
	return max(len, tmp)
print(fibonacci(n, arr))


n = int(input())
a = list(map(int, input().split()))
if n < 3:
	print(n)
else:
	(z, x) = (2, 0)
	for i in range(2, len(a)):
		if a[i] == a[i - 1] + a[i - 2]:
			z += 1
		else:
			z = 2
		x = max(x, z)
	print(max(x, z))


n = int(input())
l = list(map(int, input().split()))
s = min(2, n)
ind = 0
for i in range(2, n):
	if l[i] == l[i - 1] + l[i - 2]:
		if ind == 0:
			ind = 3
		else:
			ind += 1
		s = max(s, ind)
	else:
		ind = 0
print(s)


n = int(input())
a = list(map(int, input().split()))
count = 0
ans = -1
for i in range(2, len(a)):
	if a[i] == a[i - 1] + a[i - 2]:
		count += 1
	else:
		c = i
		ans = max(ans, count)
		count = 0
ans = max(ans, count)
if n == 1:
	print(1)
elif ans == 0:
	print(2)
else:
	print(ans + 2)


def fun(s):
	temp = 2
	max_num = 2
	if len(s) == 1:
		return 1
	elif len(s) == 2:
		return 2
	else:
		for i in range(len(s[2:])):
			if s[i + 2] == s[i + 1] + s[i]:
				temp = temp + 1
				if max_num > temp:
					max_num = max_num
				else:
					max_num = temp
			else:
				temp = 2
	return max_num
t = int(input().strip())
s = input()
s = [int(i) for i in s.split()]
print(fun(s))


import sys
t = 1
mod = 10 ** 9 + 7
for __ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	cnt = 2
	maxi = 2
	for i in range(2, n):
		if l[i - 1] + l[i - 2] == l[i]:
			cnt += 1
		else:
			maxi = max(maxi, cnt)
			cnt = 2
	maxi = max(cnt, maxi)
	if n == 1:
		maxi = 1
	print(maxi)


n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	s = 0
	c = 0
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			c += 1
			s = max(s, c)
		else:
			c = 0
	print(s + 2)


n = int(input())
l = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	c = 2
	t = []
	j = 2
	while j < n:
		for i in range(j, n):
			if l[i] == l[i - 1] + l[i - 2]:
				c += 1
			else:
				break
		j = i + 1
		t.append(c)
		c = 2
	print(max(t))


n = int(input().rstrip())
arr = list(map(int, input().rstrip().split()))
lengthList = list()
length = 0
for i in range(2, len(arr)):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		length += 1
	else:
		lengthList.append(length + 2)
		length = 0
if length != 0:
	lengthList.append(length + 2)
if len(lengthList) == 0 and n <= 2:
	print(n)
else:
	print(max(lengthList))


n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
	exit()
dp = [0] * n
dp[0] = 1
dp[1] = 2
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		dp[i] = dp[i - 1] + 1
	elif dp[i - 1] == 1:
		dp[i] = 2
	elif dp[i - 1] >= 2:
		dp[i] = 2
	else:
		dp[i] = 1
print(max(dp))


n = int(input())
m = [int(i) for i in input().split()]
if len(m) >= 2:
	phib1 = m[0]
	phib2 = m[1]
	phib3 = phib1 + phib2
	MAX_PHIB = 2
	x = 2
else:
	x = 1
	MAX_PHIB = 1
for i in range(2, n):
	if phib3 == m[i]:
		x += 1
		phib1 = phib2
		phib2 = phib3
		phib3 = phib1 + phib2
	else:
		phib1 = m[i - 1]
		phib2 = m[i]
		phib3 = phib1 + phib2
		x = 2
	if MAX_PHIB < x:
		MAX_PHIB = x
print(MAX_PHIB)


n = int(input())
arr = list(map(int, input().split()))
if n < 3:
	print(n, end='')
else:
	max_length = 2
	temp = max_length
	for i in range(2, n):
		if arr[i - 2] + arr[i - 1] == arr[i]:
			temp += 1
		else:
			if temp > max_length:
				max_length = temp
			temp = 2
	if temp > max_length:
		max_length = temp
	print(max_length, end='')


n = int(input())
a = list(map(int, input().split()))
altime_max = 2
current = 2
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		current += 1
	else:
		altime_max = max(altime_max, current)
		current = 2
altime_max = max(altime_max, current)
if n == 1:
	print(1)
else:
	print(altime_max)


from sys import stdin
import math
from collections import defaultdict
n = int(stdin.readline())
nums = list(map(int, stdin.readline().rstrip().split(' ')))
if n == 1:
	print(1)
else:
	m = -math.inf
	cur = 2
	for i in range(2, len(nums)):
		if nums[i - 1] + nums[i - 2] == nums[i]:
			cur += 1
			m = max(m, cur)
		else:
			m = max(m, cur)
			cur = 2
	print(max(m, 2))


n = int(input())
s1 = 2
s = [1]
a = list(map(int, input().split()))
for i in range(2, n):
	if a[i] != a[i - 1] + a[i - 2]:
		s.append(s1)
		s1 = 2
	else:
		s1 += 1
s.append(s1)
if n == 1:
	print(1)
else:
	print(min(max(s), n))


n = int(input())
a = list(map(int, input().split()))
(start, end) = (0, 2 if n >= 2 else 1)
while end <= n - 1:
	next_element = a[end]
	(prev1, prev2) = (a[end - 1], a[end - 2])
	if next_element == prev1 + prev2:
		end += 1
	else:
		break
max_length = end - start
while end <= n - 1:
	start += 1
	if end - start < 2:
		end += 1
	while end <= n - 1:
		next_element = a[end]
		(prev1, prev2) = (a[end - 1], a[end - 2])
		if next_element == prev1 + prev2:
			end += 1
		else:
			length = end - start
			if length > max_length:
				max_length = length
			break
length = end - start
if length > max_length:
	max_length = length
print(max_length)


n = int(input())
a = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	m = 2
	maxi = 2
	j = 2
	while j < n:
		if a[j] == a[j - 1] + a[j - 2]:
			m += 1
			if m >= maxi:
				maxi = m
		else:
			m = 2
		j += 1
	print(maxi)


def readln():
	return tuple(map(int, input().split()))
(n,) = readln()
a = readln()
l = [0] * n
l[0] = 1
for _ in range(1, n):
	if _ > 1 and a[_] == a[_ - 1] + a[_ - 2]:
		l[_] = l[_ - 1] + 1
	else:
		l[_] = 2
print(max(l))


n = int(input())
Test = list(map(int, input().split()))
if n >= 2:
	Max = [2]
else:
	Max = [1]
M = 0
for i in range(1, n - 1):
	if Test[i] + Test[i - 1] == Test[i + 1]:
		if M == 0:
			M += 3
		else:
			M += 1
	else:
		Max.append(M)
		M = 0
Max.append(M)
print(max(Max))


import io
import os
import math

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(2, n):
		b[i] = 1 if a[i] == a[i - 1] + a[i - 2] else 0
	_max = 0
	_curr = 0
	pos = 0
	while pos < n:
		if b[pos] == 1:
			_curr += 1
		else:
			_max = max(_max, _curr)
			_curr = 0
		pos += 1
	_max = max(_max, _curr)
	print(min(_max + 2, n))
main()


from sys import stdin, stdout
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))
for _ in range(1):
	n = nmbr()
	a = lst()
	ans = 2 if n >= 2 else 1
	c = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			c += 1
		else:
			c = 2
		ans = max(c, ans)
	print(ans)


def main():
	n = int(input())
	lst = input().split()
	if n <= 2:
		print(n)
	else:
		len = res = 2
		for i in range(2, lst.__len__()):
			if int(lst[i]) == int(lst[i - 1]) + int(lst[i - 2]):
				len += 1
			else:
				res = max(len, res)
				len = 2
		res = max(len, res)
		print(res)
main()


n = int(input())
a = [int(x) for x in input().split()]
r = [x == y for (x, y) in zip((t + k for (t, k) in zip(a[:-2], a[1:-1])), a[2:])]
ans = 2
if len(a) < 3:
	print(len(a))
	return
ptr = 0
while ptr < n:
	last = ptr
	while ptr + 2 < n and r[ptr]:
		ptr += 1
	ans = max(ans, ptr - last + 2)
	ptr += 1
print(ans)


L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
n = I()
a = L()
if n == 1:
	print('1')
	exit()
else:
	x = 2
y = 2
for i in range(2, n):
	if a[i] != a[i - 1] + a[i - 2]:
		x = max(x, y)
		y = 2
	else:
		y += 1
print(max(x, y))


n = int(input())
a = list(map(int, input().split(' ')))
res = 0
num = 0
for i in range(2, len(a), 1):
	if a[i] == a[i - 1] + a[i - 2]:
		num += 1
	else:
		num = 0
	if num > res:
		res = num
print(min(res + 2, n))


import sys
import string
from collections import Counter, defaultdict
from math import fsum, sqrt, gcd, ceil, factorial
from itertools import combinations, permutations
flush = lambda : sys.stdout.flush
comb = lambda x, y: factorial(x) // factorial(y) // factorial(x - y)
ip = lambda : input()
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
n = ii()
arr = rr()
a = [False] * (n + 2)
if n == 1:
	exit(print(1))
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		a[i] = True
ans = curr = 0
for i in a:
	if not i:
		ans = max(curr, ans)
		curr = 0
	else:
		curr += 1
print(ans + 2)


n = int(input())
l = list(map(int, input().split()))
if len(l) <= 2:
	print(len(l))
else:
	(mx, i, n) = (0, 2, len(l))
	while i < n:
		j = i
		while j < n and l[j - 1] + l[j - 2] == l[j]:
			j += 1
		mx = max(mx, j - i + 2)
		if i == j:
			j += 1
		i = j
	print(mx)


n = int(input())
a = list(map(int, input().split()))
if n < 3:
	print(n)
else:
	x = [2]
	cnt = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			cnt += 1
		else:
			x.append(cnt)
			cnt = 2
	x.append(cnt)
	print(max(x))


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	n = I()
	lis = L()
	if n > 1:
		mx = 2
		val = 2
		for i in range(2, n):
			if lis[i] == lis[i - 1] + lis[i - 2]:
				val += 1
			else:
				mx = max(mx, val)
				val = 2
		mx = max(mx, val)
		print(mx)
	else:
		print(1)
main()


n = int(input())
if n == 1:
	print(1)
else:
	it = [int(k) for k in input().split()]
	l = 2
	r = 2
	for i in range(2, n):
		if it[i] == it[i - 1] + it[i - 2]:
			l += 1
			r = max(r, l)
		else:
			l = 2
	print(r)


n = int(input())
arr = [int(i) for i in input().split()]
if n <= 2:
	print(n)
else:
	ans = 2
	c = 0
	best = 0
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			c += 1
			best = max(best, c)
		else:
			c = 0
	print(ans + best)


n = int(input())
L = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	length = 2
	i = 2
	maxx = 2
	while i < n:
		if L[i] == L[i - 1] + L[i - 2]:
			length += 1
		else:
			if length > maxx:
				maxx = length
			length = 2
		i += 1
	if length > maxx:
		maxx = length
	print(maxx)


from itertools import permutations

def main():
	n = int(input())
	(l, local, ans) = ([int(i) for i in input().split()], 2, 2)
	if n == 1:
		ans = local = 1
	if n > 2:
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				local += 1
			else:
				ans = max(ans, local)
				local = 2
	print(max(ans, local))
main()


n = int(input().strip())
arr = list(map(int, input().strip().split()))
res = min(n, 2)
curpart = 2
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		curpart += 1
		res = max(res, curpart)
	else:
		curpart = 2
print(res)


n = int(input())
nums = list(map(int, input().split()))
if n == 1:
	print(1)
	exit()
if n == 2:
	print(2)
	exit()
max = 2
cur = 2
for i in range(2, n):
	if nums[i] == nums[i - 1] + nums[i - 2]:
		cur += 1
	else:
		cur = 2
	if cur > max:
		max = cur
print(max)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
if n == 1:
	print(1)
	exit()
if n == 2:
	print(2)
	exit()
ans = 2
i = 0
j = 1
k = 2
curr = 2
while k < n:
	if Arr[k] == Arr[i] + Arr[j]:
		curr += 1
	else:
		ans = max(ans, curr)
		curr = 2
	i = j
	j = k
	k += 1
print(max(ans, curr))


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
a = list(map(int, input().split()))
ans = 2
if n < 3:
	ans = n
i = 2
maxi = 2
while i < n:
	if a[i - 1] + a[i - 2] == a[i]:
		maxi += 1
		ans = max(ans, maxi)
	else:
		maxi = 2
	i += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	m = 2
	l = 0
	for r in range(2, n):
		if a[r] == a[r - 1] + a[r - 2]:
			if l == 0:
				l = 3
			else:
				l += 1
			m = max(m, l)
		else:
			l = 0
	print(m)


n = int(input())
a = list(map(int, input().rstrip().split()))
j = 0
maxi = 2
if n == 1:
	print(1)
	exit()
if n == 2:
	print(2)
	exit()
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		pass
	else:
		maxi = max(maxi, i - 1 - j + 1)
		j = i - 1
if i == n - 1:
	maxi = max(maxi, i - j + 1)
else:
	maxi = max(maxi, i - j)
print(maxi)


n = int(input())
arr = list(map(int, input().split()))
(res, d) = (0, 0)
for i in range(n):
	if i < 2 or arr[i] == arr[i - 1] + arr[i - 2]:
		d += 1
	else:
		d = 2
	res = max(res, d)
print(res)


n = int(input())
a = list(map(int, input().split()))
(c, res) = (0, 0)
for i in range(n):
	c = [2, c + 1][i < 2 or a[i] == a[i - 1] + a[i - 2]]
	res = max(res, c)
print(res)


def main():
	n = int(input())
	seq = [int(i) for i in input().split()]
	if n < 3:
		print(n)
		return
	(ans, i) = (2, 2)
	while i < n:
		(t, l) = (i, 2)
		while t < n and seq[t] == seq[t - 1] + seq[t - 2]:
			t += 1
			l += 1
		ans = max(ans, l)
		i = t if t > i else i + 1
	print(ans)
main()


n = int(input())
a = (*map(int, input().split()),)
c = [[0, 1][x + y == z] for (x, y, z) in zip(a, a[1:], a[2:])] + [0]
for i in range(1, n - 2):
	c[i] = c[i] * (c[i] + c[i - 1])
print(max(c) + 2 - (n < 2))


n = int(input())
l = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	ans = 2
	temp = 2
	for i in range(2, len(l)):
		if l[i] == l[i - 1] + l[i - 2]:
			temp += 1
		else:
			if temp > ans:
				ans = temp
			temp = 2
	if ans < temp:
		ans = temp
	print(ans)


n = int(input())
inp = [int(x) for x in input().split()]
if len(inp) < 3:
	maxlen = lenght = len(inp)
else:
	maxlen = lenght = 2
for i in range(2, len(inp)):
	if inp[i] == inp[i - 1] + inp[i - 2]:
		lenght += 1
		if lenght > maxlen:
			maxlen = lenght
	else:
		if lenght > maxlen:
			maxlen = lenght
		lenght = 2
print(maxlen)


n = int(input())
k = list(map(int, input().split()))
ans = 1
c = 0
if n >= 2:
	ans = 2
for i in range(2, n):
	if k[i] == k[i - 1] + k[i - 2]:
		c += 1
	else:
		c = 0
	ans = max(ans, c + 2)
print(ans)


n = int(input())
A = [*map(int, input().split())]
k = x = min(n, 2)
for i in range(n - 2):
	k = k + 1 if A[i] + A[i + 1] == A[i + 2] else 2
	x = max(k, x)
print(x)


from __future__ import division, print_function
import math
import os
import sys
from sys import stdin, stdout
from io import BytesIO, IOBase
from itertools import accumulate
from collections import deque
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False
import math

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	max = 0
	if len(arr) == 1:
		print(1)
	elif len(arr) == 2:
		print(2)
	else:
		cnt = 2
		for i in range(n - 2):
			if arr[i + 2] == arr[i + 1] + arr[i]:
				cnt += 1
			else:
				if cnt > max:
					max = cnt
				cnt = 2
		if cnt > max:
			max = cnt
		print(max)
main()


n = int(input())
a = list(map(int, input().split()))
r = min(2, len(a))
k = 0
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		if k == 0:
			k = 3
		else:
			k += 1
		r = max(r, k)
	else:
		k = 0
print(r)


n = int(input())
a = list(map(int, input().split()))
mx = 0
ct = 0
for i in range(n - 2):
	if a[i] + a[i + 1] == a[i + 2]:
		ct += 1
		if ct > mx:
			mx = ct
	else:
		ct = 0
if n <= 2:
	print(n)
else:
	print(mx + 2)


from sys import *
from math import *
from sys import stdin, stdout
from collections import *
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
n = int(input())
arr = int_arr()
if n <= 2:
	print(n)
else:
	mx = 0
	ct = 2
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			ct += 1
		else:
			ct = 2
		mx = max(mx, ct)
	print(mx)


n = int(input())
A = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	i = 0
	max_len = 2
	length = 2
	while i < n - 2:
		j = i + 1
		k = i + 2
		if A[i] + A[j] == A[k]:
			length += 1
			max_len = max(max_len, length)
		else:
			length = 2
			max_len = max(max_len, length)
		i += 1
	print(max_len)


n = int(input())
an = list(map(int, input().split()))

def reslove():
	if n < 3:
		return n
	i_len = 2
	max_len = 2
	for i in range(2, n):
		if an[i] == an[i - 1] + an[i - 2]:
			i_len += 1
		else:
			max_len = max_len if max_len > i_len else i_len
			i_len = 2
	max_len = max_len if max_len > i_len else i_len
	return max_len
print(reslove())


n = int(input())
a = list(map(int, input().split()))
count = min(2, n)
maxcount = count
flag = 0
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		count += 1
	if a[i] != a[i - 1] + a[i - 2]:
		if maxcount < count:
			maxcount = count
			flag = 1
		count = 2
if flag == 0 or maxcount < count:
	maxcount = count
print(maxcount)


def main():
	n = int(input())
	l = list(map(int, input().split()))
	res = len(l)
	if res > 2:
		res = m = 2
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				m += 1
			else:
				if res < m:
					res = m
				m = 2
		if res < m:
			res = m
	print(res)

def __starting_point():
	main()
__starting_point()


n = int(input())
list1 = list(map(int, input().split()))
c = 0
cc = 0
for i in range(n):
	if c == 0 or c == 1:
		c += 1
		continue
	elif list1[i] == list1[i - 1] + list1[i - 2]:
		c += 1
	else:
		if c > cc:
			cc = c
		c = 2
if c > cc:
	cc = c
print(cc)


import collections
n = int(input())
arr = list(map(int, input().split()))
if n < 3:
	print(n)
	exit()
ans = 2
c = 2
for i in range(2, n):
	if arr[i] == arr[i - 2] + arr[i - 1]:
		c += 1
	else:
		c = 2
	ans = max(ans, c)
print(ans)


n = int(input())
a = list(map(int, input().split()))
if len(a) == 1:
	print(1)
elif len(a) == 2:
	print(2)
else:
	z = []
	j = 2
	c = 0
	while j < n:
		if a[j] == a[j - 1] + a[j - 2]:
			c += 1
		else:
			z.append(c)
			c = 0
		j += 1
	z.append(c)
	print(max(z) + 2)


n = int(input())
l = [int(x) for x in input().split()]
(c, ans) = (0, 0)
for i in range(len(l)):
	c = [2, c + 1][i < 2 or l[i] == l[i - 1] + l[i - 2]]
	ans = max(ans, c)
print(ans)


n = int(input())
arr = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	ans = 2
	i = 2
	while i < n:
		if arr[i] == arr[i - 1] + arr[i - 2]:
			count = 2
			while i < n and arr[i] == arr[i - 1] + arr[i - 2]:
				i += 1
				count += 1
			ans = max(ans, count)
		else:
			i += 1
	print(ans)


n = int(input())
l = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	x = 0
	y = 1
	max = 2
	ans = []
	ans.append(max)
	for i in range(2, n):
		if l[i] == l[x] + l[y]:
			x += 1
			y += 1
			max += 1
			ans.append(max)
		else:
			x += 1
			y += 1
			max = 2
	ans.sort()
	print(ans[-1])


n = int(input())
a = list(map(int, input().split()))[:n]
if n <= 2:
	print(n)
else:
	c = 1
	d = []
	for i in range(n - 2):
		if a[i] + a[i + 1] == a[i + 2]:
			c += 1
		elif a[i] + a[i + 1] != a[i + 2]:
			d.append(c + 1)
			c = 1
		if i == n - 3:
			d.append(c + 1)
	print(max(d))


n = int(input())
a = list(map(int, input().split(' ')))
ans = min(n, 2)
cnt = 2
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		cnt += 1
		ans = max(ans, cnt)
	else:
		cnt = 2
print(ans)


n = int(input())
arr = list(map(int, input().split()))
(i, ans, c) = (n - 1, 0, 0)
while i - 2 >= 0:
	if arr[i] == arr[i - 1] + arr[i - 2]:
		c += 1
	else:
		if c > 0:
			ans = max(ans, c + 2)
		else:
			ans = max(ans, 1)
		c = 0
	i -= 1
if c > 0:
	print(max(ans, c + 2))
elif ans == 1 and n > 1:
	print(2)
elif n == 1 or n == 2:
	print(n)
else:
	print(ans)


n = int(input())
arr = list(map(int, input().split()))
arr_2 = [2 for x in range(n)]
if n == 1:
	print(1)
else:
	ans = 2
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			arr_2[i] = arr_2[i - 1] + 1
			ans = max(ans, arr_2[i])
	print(ans)


import sys
import math
n = int(sys.stdin.readline())
an = [int(x) for x in sys.stdin.readline().split()]
if n == 1 or n == 2:
	print(n)
	exit()
vmax = 2
r = vmax
for i in range(2, n):
	if an[i] == an[i - 1] + an[i - 2]:
		r += 1
	else:
		if r > vmax:
			vmax = r
		r = 2
if r > vmax:
	vmax = r
print(vmax)


n = int(input())
arr = list(map(int, input().split(' ')))
count = 2
mat = [2]
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		count += 1
	else:
		mat.append(count)
		count = 2
mat.append(count)
if len(arr) == 1:
	print(1)
else:
	print(max(mat))


n = int(input())
a = list(map(int, input().split()))
if n in (1, 2):
	print(n)
else:
	l = 0
	res = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			res = max(res, i - l + 1)
		else:
			l = i - 1
	print(res)


n = int(input())
l = list(map(int, input().strip().split()))
prefix = [1, 2]
flag5 = 0
i = 2
while i < n:
	if l[i] == l[i - 1] + l[i - 2]:
		prefix.append(prefix[-1] + 1)
	else:
		prefix.append(2)
	i += 1
cur = 0
glob = 0
for i in l:
	if i == 0:
		cur += 1
	else:
		cur = 0
	glob = max(glob, cur)
if n == 1:
	print(1)
else:
	print(max(glob, max(prefix)))


n = int(input())
l = list(map(int, input().split()))
ma = 2
count = 2
if n <= 2:
	print(n)
else:
	for k in range(2, n):
		if l[k - 2] + l[k - 1] == l[k]:
			count += 1
			if count > ma:
				ma = count
		else:
			count = 2
	print(ma)


n = int(input())
a = [int(i) for i in input().split()]
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	maxi = 2
	temp = a[0]
	k = 2
	for i in range(1, len(a) - 1):
		if temp + a[i] == a[i + 1]:
			k += 1
		elif k > maxi:
			maxi = k
			k = 2
		else:
			k = 2
		temp = a[i]
	if k > maxi:
		maxi = k
	print(maxi)


n = int(input())
a = list(map(int, input().split()))
count = 0
mcount = 0
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		count += 1
	else:
		mcount = max(mcount, count)
		count = 0
mcount = max(mcount, count)
if n == 1:
	print(1)
else:
	print(mcount + 2)


n = int(input())
vals = list(map(int, input().split()))
mlen = 1
cur = 1
if n > 1:
	mlen = 2
	cur = 2
i = 2
while i < n:
	if vals[i - 2] + vals[i - 1] == vals[i]:
		cur += 1
		mlen = max(mlen, cur)
	else:
		cur = 1
		if n > 1:
			cur = 2
	i += 1
print(mlen)


def solve(arr):
	n = len(arr)
	count = res = min(n, 2)
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			count += 1
		else:
			count = 2
		res = max(res, count)
	return res
input()
res = solve(list(map(int, input().split())))
print(res)


n = int(input())
p = list(map(int, input().split()))
(curr_cnt, max_cnt) = (2, 2)
if n <= 2:
	print(n)
else:
	for i in range(2, n):
		if p[i] == p[i - 1] + p[i - 2]:
			curr_cnt += 1
		else:
			curr_cnt = 2
		max_cnt = max(max_cnt, curr_cnt)
	print(max_cnt)


z = int(input())
x = list(map(int, input().split()))
x.reverse()
d = []
for i in range(z - 2):
	if x[i] == x[i + 1] + x[i + 2]:
		d.append(x[i])
		d.append(x[i + 1])
		d.append(x[i + 2])
		break
e = []
try:
	for o in range(i + 1, z - 2):
		if x[o] == x[o + 1] + x[o + 2]:
			d.append(x[o + 2])
		else:
			e.append(len(d))
			d = []
			if x[o + 1] == x[o + 2] + x[o + 3]:
				d.append(x[o + 1])
				d.append(x[o + 2])
except:
	e.append(1)
e.append(len(d))
if z >= 2 and x[-1] == x[-2]:
	e.append(2)
if z == 2:
	e.append(2)
print(max(e))


n = int(input())
a = [int(i) for i in input().split()]
l = []
if n == 1 or n == 2:
	print(n)
else:
	d = 2
	for i in range(2, len(a)):
		if a[i - 1] + a[i - 2] == a[i]:
			d = d + 1
		else:
			l.append(d)
			d = 2
	l.append(d)
	print(max(l))


n = int(input())
arr = list(map(int, input().split()))

def segment(n, arr):
	if n <= 2:
		print(n)
		return
	i = m = 0
	x = 2
	while i < n - 2:
		if arr[i] + arr[i + 1] == arr[i + 2]:
			x += 1
			i += 1
		else:
			m = max(x, m)
			x = 2
			i += 1
	m = max(m, x)
	print(m)
segment(n, arr)


n = int(input())
li = list(map(int, input().split()))
dp = [1 for i in range(n)]
for i in range(2, n):
	if li[i] == li[i - 1] + li[i - 2]:
		if dp[i - 1] != 1:
			dp[i] = dp[i - 1] + 1
		else:
			dp[i] = 3
if max(dp) == 1:
	if n != 1:
		print(2)
	else:
		print(1)
else:
	print(max(dp))


n = int(input())
arr = [int(x) for x in input().split()]
if n <= 2:
	print(n)
else:
	(m, ans) = (2, 2)
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			m += 1
		else:
			m = 2
		ans = max(ans, m)
	print(ans)


n = input()
n = int(n)
line = input()
num_list = [int(l) for l in line.split()]
count = 2
count_list = []
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	for i in range(2, n):
		if num_list[i] == num_list[i - 1] + num_list[i - 2]:
			count += 1
		else:
			count_list.append(count)
			count = 2
	count_list.append(count)
	print(max(count_list))


n = int(input())
inp = list(map(int, input().split()))
cntr = 2
m = 0
if n <= 2:
	print(n)
	exit()
else:
	for i in range(n - 2):
		if inp[i] + inp[i + 1] == inp[i + 2]:
			cntr += 1
		else:
			m = max(m, cntr)
			cntr = 2
print(max(m, cntr))


def solve(n, nums):
	if n == 1:
		return 1
	if n == 2:
		return 2
	maxscore = 0
	i = 2
	while i < n:
		score = 2
		while i < n and nums[i] == nums[i - 1] + nums[i - 2]:
			i += 1
			score += 1
		if score > maxscore:
			maxscore = score
		i += 1
	return maxscore
n = int(input())
nums = list(map(int, input().split()))
print(solve(n, nums))


n = int(input())
seq = list(map(int, input().split()))
maxcount = 0
count = 0
for i in range(n):
	if count < 2:
		count += 1
	elif seq[i - 1] + seq[i - 2] == seq[i]:
		count += 1
	else:
		if count > maxcount:
			maxcount = count
		count = 2
if count > maxcount:
	maxcount = count
print(maxcount)


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)
import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
S = lambda : list(map(str, input().split()))
(n,) = I()
a = I()
a_i1 = a[0]
longest = 1
present = 1
for i in range(1, len(a)):
	if present == 1:
		present = present + 1
	elif a[i] == a_i1 + a_i2:
		present = present + 1
	else:
		if present >= longest:
			longest = present
		present = 2
	a_i2 = a_i1
	a_i1 = a[i]
	if i == len(a) - 1:
		if present >= longest:
			longest = present
print(longest)


a = int(input())
if a < 2:
	print(a)
else:
	x = list(map(int, input().split()))
	y = [0 for i in range(a)]
	for i in range(2, a):
		if x[i] == x[i - 1] + x[i - 2]:
			y[i] = 1
	long = 0
	streak = 0
	for i in range(a):
		if y[i] == 1:
			streak += 1
			long = max(long, streak)
		else:
			streak = 0
	print(long + 2)


def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	if n == 1:
		return 1
	elif n == 2:
		return 2
	i = 2
	global_max = 2
	current_max = 2
	while i < n:
		if a[i - 1] + a[i - 2] == a[i]:
			current_max += 1
		else:
			if current_max > global_max:
				global_max = current_max
			current_max = 2
		i += 1
	if global_max < current_max:
		return current_max
	return global_max
print(go())


n = int(input())
nums = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	length = 2
	lens = []
	for i in range(2, n):
		if nums[i - 2] + nums[i - 1] == nums[i]:
			length += 1
		else:
			lens.append(length)
			length = 2
	lens.append(length)
	print(max(lens))


import os
import sys
import math
from io import BytesIO, IOBase
from collections import deque, defaultdict, OrderedDict, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, insort, bisect_left
from functools import lru_cache
sys.setrecursionlimit(10 ** 6)

def STRIN():
	return input()

def INTIN():
	return int(input())

def LINT():
	return list(map(int, input().split()))

def LSTR():
	return list(map(str, input().split()))

def MINT():
	return map(int, input().split())

def MSTR():
	return map(str, input().split())

def solve(s):
	if s == s[::-1]:
		return True
	return False

def main():
	n = INTIN()
	l = LINT()
	p = [0] * n
	if n == 1:
		print(1)
	elif n == 2:
		print(2)
	else:
		k = 2
		p[0] = 1
		p[1] = 2
		while k < n:
			if l[k] == l[k - 1] + l[k - 2]:
				p[k] = p[k - 1] + 1
				k += 1
			else:
				p[k] = 0
				j = k + 1
				while j < n:
					if l[j] == l[j - 1] + l[j - 2]:
						p[j] = 3
						break
					else:
						p[j] = 0
					j += 1
				k = j + 1
		print(max(p))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
a = list(map(int, input().split()))
count = 2
maxi = 2
for i in range(2, n):
	if a[i] != a[i - 1] + a[i - 2]:
		if maxi < count:
			maxi = count
		count = 2
	else:
		count += 1
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	print(max(2, maxi, count))


import sys
ii = lambda : int(sys.stdin.readline())
mi = lambda : map(int, sys.stdin.readline().split())
li = lambda : list(mi())

def main():
	n = ii()
	l = li()
	c = n
	if c > 2:
		c = m = 2
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				m += 1
			else:
				if c < m:
					c = m
				m = 2
		if c < m:
			c = m
	print(c)
main()


n = int(input())
L = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	maxlen = 0
	count = 2
	first = L[0]
	second = L[1]
	i = 2
	while i < n:
		if L[i] == L[i - 1] + L[i - 2]:
			count += 1
		else:
			maxlen = max(maxlen, count)
			count = 2
		i += 1
	maxlen = max(maxlen, count)
	print(maxlen)


n = int(input())
a = [int(i) for i in input().split()]
if n <= 2:
	print(n)
	exit()
(i, j) = (0, 2)
ans = [1, 2]
while j < n:
	i = j - 2
	while j < n and a[j] == a[j - 1] + a[j - 2]:
		j += 1
	ans.append(j - i)
	j += 1
print(max(ans))


n = int(input())
ar = list(map(int, input().split()))
l = 0
l_temp = 0
for i in range(n):
	if i > 1:
		if ar[i] == ar[i - 1] + ar[i - 2]:
			l_temp += 1
			if l_temp > l:
				l = l_temp
		else:
			l_temp = 0
if n < 2:
	print(n)
else:
	print(l + 2)


n = int(input())
l = list(map(int, input().split()))
cur = 2
best = 2
if n == 1:
	best = 1
	cur = 1
else:
	for i in range(2, n):
		if l[i] == l[i - 1] + l[i - 2]:
			cur += 1
		else:
			best = max(best, cur)
			cur = 2
print(max(best, cur))


n = int(input())
l = [int(i) for i in input().split()]
if n < 3:
	print(n)
else:
	s = 2
	smax = 2
	a = l[0]
	b = l[1]
	for i in l[2:]:
		if a + b == i:
			s += 1
		else:
			smax = max(smax, s)
			s = 2
		a = b
		b = i
	print(max(smax, s))


n = int(input())
s = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	max1 = 2
	temp = 2
	for i in range(2, n):
		if s[i] == s[i - 1] + s[i - 2]:
			temp += 1
			if temp > max1:
				max1 = temp
		else:
			temp = 2
	print(max1)


def solve(arr):
	n = len(arr)
	res = min(n, 2)
	l = 0
	while l < n - 2:
		for r in range(l + 1, n):
			if r > l + 1 and arr[r] != arr[r - 1] + arr[r - 2]:
				break
			res = max(res, r - l + 1)
		l = r - 1
	return res
input()
res = solve(list(map(int, input().split())))
print(res)


n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	l = [2]
	k = 2
	for i in range(2, len(a)):
		if a[i] != a[i - 1] + a[i - 2]:
			l.append(k)
			k = 2
		else:
			k += 1
	l.append(k)
	print(max(l))


n = int(input())
a = list(map(int, input().split()))
c = [False] * n
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		c[i] = True
m = 0
j = 0
i = 2
l = 0
while i < n:
	if c[i] == False:
		if l > m:
			m = l
			j = i - l + 1
		l = 0
	else:
		l += 1
	i += 1
if l != 0 and l > m:
	m = l
	j = i - l
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	print(m + 2)


n = int(input())
A = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	MAX_L = 2
	i1 = 0
	i2 = 1
	while i2 < n:
		CUR_L = 2
		while i2 < n - 1 and A[i1] + A[i2] == A[i2 + 1]:
			i1 += 1
			i2 += 1
			CUR_L += 1
		MAX_L = max(MAX_L, CUR_L)
		i1 += 1
		i2 += 1
	print(MAX_L)


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
n = ii()
a = li()
if n <= 2:
	print(n)
	exit()
c = 0
l = []
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		c += 1
	else:
		l.append(c)
		c = 0
	l.append(c)
print(max(l) + 2)


a = int(input())
s = [int(i) for i in input().split()]
i = 2
c = 2
maxi = 0
if len(s) <= 2:
	print(len(s))
else:
	while i < len(s):
		while i < len(s) and s[i] == s[i - 1] + s[i - 2]:
			c += 1
			i += 1
		else:
			maxi = max(maxi, c)
			c = 2
			i += 1
	print(maxi)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
n = L()[0]
A = L()
if n < 3:
	print(n)
	exit()
dp = [0 for i in range(n)]
ans = 2
dp[0] = 1
dp[1] = 2
for i in range(2, n):
	if A[i] == A[i - 1] + A[i - 2]:
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = 2
print(max(dp))
endtime = time.time()


n = int(input())
a = list(map(int, input().split()))
l = [2] if n >= 2 else [1]
i = 2
while i < len(a):
	if a[i] == a[i - 1] + a[i - 2]:
		l[-1] = l[-1] + 1
	else:
		l.append(2)
	i += 1
print(max(l))


n = int(input())
x = list(map(int, input().split()))
(a, m) = (2, 2)
if n <= 1:
	m = 1
for i in range(2, n):
	if x[i] == x[i - 1] + x[i - 2]:
		a += 1
	else:
		a = 2
	m = max(m, a)
print(m)


__author__ = 'Lipen'

def actions(n, a):
	lmax = 2
	if n <= 2:
		return n
	i = 0
	l = 2
	while i < n - 2:
		q = a[i]
		w = a[i + 1]
		x = a[i + 2]
		if x == q + w:
			l += 1
		else:
			if l > lmax:
				lmax = l
			l = 2
		i += 1
	if l > lmax:
		lmax = l
	return lmax

def main():
	n = int(input())
	a = list(map(int, input().split()))
	print(actions(n, a))

def __starting_point():
	main()
__starting_point()


n = int(input())
a = list(map(int, input().split()))
if n < 3:
	print(n)
	exit()
(l, r) = (0, 2)
max_len = r - l
while r < n:
	while r < n and a[r] == a[r - 2] + a[r - 1]:
		r += 1
	max_len = max(max_len, r - l)
	l = r - 1
	r += 1
print(max_len)


n = int(input())
m = list(map(int, input().split()))
if n < 3:
	print(n)
	exit()
ans = 2
p = 0
for i in range(n - 2):
	j = i + 1
	k = j + 1
	if m[i] + m[j] == m[k]:
		ans += 1
	else:
		ans = 2
	p = max(ans, p)
print(p)


__author__ = 'asmn'
n = int(input())
a = list(map(int, input().split()))
(ans, nl) = (0, 0)
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		nl += 1
		ans = max(ans, nl)
	else:
		nl = 0
print(ans + min(2, n))


n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(1)
	exit(0)
else:
	b = [2] * n
l = 0
i = 0
while i < n - 2:
	if a[i] + a[i + 1] == a[i + 2]:
		b[l] += 1
		i += 1
	else:
		l += 1
		i += 1
print(max(b))


n = int(input())
line = str(input()).split()
line = [int(it) for it in line]
if n < 3:
	print(n)
else:
	tar = curr = 2
	for i in range(2, n):
		if line[i] == line[i - 1] + line[i - 2]:
			curr += 1
		else:
			tar = max(tar, curr)
			curr = 2
	print(max(tar, curr))


length = int(input())
arr = list(map(int, input().split()))
if length <= 2:
	print(length)
	exit()
ans = 2
temp = []
for x in range(2, length):
	if arr[x] == arr[x - 1] + arr[x - 2]:
		ans += 1
	else:
		temp.append(ans)
		ans = 2
temp.append(ans)
print(max(temp))


n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	l = 2
	m = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			l += 1
			if l > m:
				m = l
		else:
			l = 2
	print(m)


n = int(input())
r = input()
li = []
for x in r.split():
	li.append(int(x))
if n == 1 or n == 2:
	maxxi = n
else:
	maxxi = 2
	maxx = 2
	for i in range(0, n - 2):
		if li[i] + li[i + 1] == li[i + 2]:
			maxx += 1
			if maxxi < maxx:
				maxxi = maxx
		else:
			maxx = 2
print(maxxi)


n = int(input())
import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
arr = get_ints()
maxcount = 0
cur = 0
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2] and cur == 0:
		cur = 3
		continue
	elif arr[i] == arr[i - 1] + arr[i - 2] and cur != 0:
		cur += 1
	else:
		maxcount = max(cur, maxcount)
		cur = 0
maxcount = max(cur, maxcount)
if maxcount == 0 and n >= 2:
	maxcount = 2
maxcount = max(maxcount, 1)
print(maxcount)


n = int(input())
a = [int(x) for x in input().split()]
i = 0
j = 2
ans = 1
while j < n:
	if a[j] == a[j - 1] + a[j - 2]:
		j += 1
		if j == n:
			ans = max(ans, j - i)
	else:
		ans = max(ans, j - i)
		i = j - 1
		j += 1
if n == 2:
	print(2)
else:
	print(ans)


n = int(input())
l = [int(i) for i in input().split()]
if n <= 2:
	print(n)
	exit()
maxi = 0
c = 0
for i in range(2, n):
	if l[i] == l[i - 1] + l[i - 2]:
		c += 1
	else:
		maxi = max(maxi, c + 2)
		c = 0
maxi = max(maxi, c + 2)
print(maxi)


n = int(input())
if n <= 2:
	print(n)
	exit(0)
r = list(map(int, input().split()))
m = 2
c = 2
for i in range(n - 2):
	if r[i + 2] == r[i] + r[i + 1]:
		c += 1
		m = max(m, c)
	else:
		c = 2
print(m)


n = int(input())
a = list(map(int, input().split()))
good = [0] * n
for i in range(2, n):
	if a[i - 2] + a[i - 1] == a[i]:
		good[i] = 1
ans = min(2, n)
cur = 0
for i in range(0, n):
	if good[i]:
		cur += 1
		ans = max(ans, cur + 2)
	else:
		cur = 0
print(ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		a = LI()
		r = min(2, n)
		c = 0
		for i in range(2, n):
			if a[i - 1] + a[i - 2] == a[i]:
				c += 1
			else:
				if r < c + 2:
					r = c + 2
				c = 0
		if c > 0 and r < c + 2:
			r = c + 2
		rr.append(r)
	return JA(rr, '\n')
print(main())


n = int(input())
a = list(map(int, input().split()))
ans = 0
d = 0
for i in range(n):
	if i < 2 or a[i] == a[i - 1] + a[i - 2]:
		d += 1
	else:
		d = 2
	if d > ans:
		ans = d
print(ans)


a = int(input())
if a == 1:
	print(1)
	quit()
x = list(map(int, input().split(' ')))
new = [0] * a
for i in range(2, a):
	if x[i] == x[i - 1] + x[i - 2]:
		new[i] = 1
streak = 0
maxstr = 2
for i in new:
	if i == 1:
		streak += 1
	else:
		maxstr = max(streak + 2, maxstr)
		streak = 0
maxstr = max(streak + 2, maxstr)
print(maxstr)


n = int(input())
w = list(map(int, input().split()))
fibArr = [0]
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	fibo = 2
	k = 2
	while k != n:
		cnt = w[k - 1] + w[k - 2]
		if cnt == w[k]:
			fibo += 1
			k += 1
			if fibo > fibArr[0]:
				fibArr[0] = fibo
		else:
			fibo = 2
			k += 1
			if fibo > fibArr[0]:
				fibArr[0] = fibo
			if k > n:
				break
	print(fibArr[0])


n = int(input())
l = list(map(int, input().split()))
cnt = 2
mx = 0
if n <= 2:
	print(n)
else:
	for i in range(2, n):
		if l[i] == l[i - 1] + l[i - 2]:
			cnt += 1
		else:
			mx = max(mx, cnt)
			cnt = 2
			if l[i] == l[i - 1] + l[i - 2]:
				cnt += 1
	mx = max(mx, cnt)
	print(mx)


n = int(input())
a = [int(i) for i in input().split()]
best = min(n, 2)
k = 2
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		k += 1
		best = max(best, k)
	else:
		k = 2
print(best)


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	if n <= 2:
		return n
	(ans, tmp) = (0, 0)
	for i in range(2, n):
		if l[i] == l[i - 1] + l[i - 2]:
			tmp += 1
		else:
			tmp = 0
		ans = max(tmp, ans)
	return min(ans + 2, n)
print(solve())


n = int(input())
l = list(map(int, input().split()))
if n == 1 or n == 2:
	print(n)
else:
	s = l[0] + l[1]
	c = 2
	m = 2
	for i in range(2, n):
		if s == l[i]:
			c = c + 1
			s = s + l[i] - l[i - 2]
		else:
			if c > m:
				m = c
			c = 2
			s = l[i] + l[i - 1]
	if c > m:
		m = c
	print(m)


n = int(input())
if n == 1 or n == 2:
	print(n)
else:
	a = list(map(int, input().split()))
	i = 2
	ans = 0
	while i < n:
		cnt = 0
		while a[i - 2] + a[i - 1] == a[i]:
			i += 1
			cnt += 1
			if i == n:
				break
		ans = max(ans, cnt)
		i += 1
	print(ans + 2)


n = int(input())
if n < 3:
	print(n)
	a = input()
else:
	a = [int(x) for x in input().split()]
	an = []
	c = 2
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			c += 1
		else:
			an.append(c)
			c = 2
	an.append(c)
	print(max(an))


__author__ = 'Rajan'
n = int(input())
a = list(map(int, input().split()))
b = [2 for i in range(n)]
b[0] = 1
ans = 1
if n > 1:
	ans = 2
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		b[i] = b[i - 1] + 1
	ans = max(ans, b[i])
print(ans)


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def main():
	n = inp()
	a = inlt()
	c = 2
	m = 0
	if n == 1:
		print('1')
		exit()
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			c += 1
		else:
			m = max(m, c)
			c = 2
		m = max(m, c)
	m = max(m, c)
	print(m)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
if n == 1:
	print(1)
else:
	arr = list(map(int, input().split()))
	import math
	max_segment_len = -math.inf
	count = 0
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			count += 1
		else:
			max_segment_len = max(max_segment_len, count)
			count = 0
	max_segment_len = max(max_segment_len, count)
	print(max_segment_len + 2)


n = int(input())
a = list(map(int, input().split()))
if n > 2:
	min_ = 2
	i = 0
	while i < n:
		t = 2
		j = i
		while j + 2 < n:
			if a[j + 2] == a[j + 1] + a[j]:
				j += 1
				t += 1
			else:
				break
		i = j + 1
		min_ = max(min_, t)
	print(min_)
else:
	print(n)


from sys import stdin
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
from math import pi
n = it()
l = mp()
if n == 1:
	print(n)
elif n == 2:
	print(2)
else:
	i = 2
	j = 0
	ans = 2
	ma = 1
	flag = 0
	while i < n:
		if l[i] == l[i - 1] + l[i - 2]:
			ans += 1
			flag = 1
		elif l[i] == l[i - 1]:
			flag = 1
		else:
			ans = 2
		i += 1
		ma = max(ans, ma)
	if flag == 1:
		print(ma)
	else:
		print(ma - 1)


n = int(input())
a = [int(x) for x in input().split()]
b = []
leng = 2
i = 2
if len(a) == 1:
	print('1')
elif len(a) == 2:
	print('2')
else:
	while i < n:
		if a[i] == a[i - 1] + a[i - 2]:
			leng += 1
			i += 1
		else:
			i += 1
			b.append(leng)
			leng = 2
	b.append(leng)
	print(max(b))


def main():
	from sys import stdin, stdout
	n = int(stdin.readline())
	a = tuple(map(int, stdin.readline().split()))
	maxim = 2
	count = 2
	i = 2
	while True:
		if i >= n:
			break
		if a[i] == a[i - 1] + a[i - 2]:
			count += 1
			maxim = max(count, maxim)
		else:
			count = 2
		i += 1
	stdout.write(str(min(maxim, n)))
main()


n = int(input())
l = list(map(int, input().strip().split()))
i = 0
count = 0
if n < 3:
	print(n)
else:
	while i < n - 2:
		c = 0
		while i < n - 2 and l[i + 2] == l[i + 1] + l[i]:
			c += 1
			i += 1
		i += 1
		if c > count:
			count = c
	print(count + 2)


n = int(input())
l = []
l = list(map(int, input().split()))
c = 2
ll = [2]
if n == 1:
	print(1)
else:
	for i in range(2, len(l)):
		if l[i] == l[i - 1] + l[i - 2]:
			c += 1
		else:
			ll.append(c)
			c = 2
	ll.append(c)
	print(max(ll))


n = int(input())
ls = [int(i) for i in input().split()]
if n == 1 or n == 2:
	print(n)
	exit()
(ans, a) = (2, 2)
for i in range(2, n):
	if ls[i] == ls[i - 1] + ls[i - 2]:
		ans += 1
		a = max(a, ans)
	else:
		ans = 2
print(a)


import sys
n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
	sys.exit()
best = 0
mem = a[:2]
cur = 0
for i in a[2:]:
	if mem[0] + mem[1] == i:
		cur += 1
	else:
		if cur > best:
			best = cur
		cur = 0
	mem = mem[1:] + [i]
if cur > best:
	best = cur
print(best + 2)


n = int(input())
l = [int(x) for x in input().split(' ')]
ans = 0
d = 0
for i in range(len(l)):
	if i < 2 or l[i] == l[i - 1] + l[i - 2]:
		d += 1
	else:
		d = 2
	if d > ans:
		ans = d
print(ans)


def main():
	n = int(input())
	l = list(map(int, input().split()))
	c = n
	if c > 2:
		c = m = 2
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				m += 1
			else:
				if c < m:
					c = m
				m = 2
		if c < m:
			c = m
	print(c)
main()


n = int(input())
a = list(map(int, input().split()))
if n < 3:
	print(n)
	exit()
r = t = 2
for i in range(2, n):
	if a[i] != a[i - 1] + a[i - 2]:
		r = max(t, r)
		t = 2
		continue
	t += 1
print(max(r, t))


n = int(input())
arr = list(map(int, input().split()))
if len(arr) == 1:
	print(len(arr))
	exit(0)
else:
	min1 = 2
	length = 2
for i in range(2, len(arr)):
	if arr[i - 1] + arr[i - 2] == arr[i]:
		length += 1
	else:
		length = 2
		if min1 < length:
			min1 = length
	if min1 < length:
		min1 = length
print(min1)


digl = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
mod = 10 ** 9 + 7
n = ii()
l = il()
mx = 0
c = 0
for i in range(2, n):
	if l[i] == l[i - 1] + l[i - 2]:
		c += 1
	else:
		mx = max(mx, c)
		c = 0
print(max(mx, c) + 2 if n > 2 else n)


def read_args():
	n = int(input())
	a = list(map(int, input().split()))
	return (a, n)

def get_good_segment_of_max_length(a, n):
	if n <= 2:
		return n
	count = 0
	current_count = 0
	for i in range(n - 2):
		if a[i] + a[i + 1] == a[i + 2]:
			current_count += 1
			if count < current_count:
				count = current_count
		else:
			current_count = 0
	return count + 2
(a, n) = read_args()
print(get_good_segment_of_max_length(a, n))


n = int(input())
a = list(map(int, input().split()))
i = 2
best = 0
ct = 0
while i < n:
	if a[i - 2] + a[i - 1] == a[i]:
		ct += 1
		best = max(best, ct)
	else:
		ct = 0
	i += 1
print(1 if n == 1 else best + 2)


n = int(input())
L = [int(i) for i in input().split()]
(lon, cnt) = (2, 2)
if n == 1 or n == 2:
	print(n)
	exit(0)
else:
	for i in range(2, n):
		if L[i] != L[i - 1] + L[i - 2]:
			cnt = 2
		else:
			cnt += 1
			if cnt > lon:
				lon = cnt
print(lon)
exit(0)


input()
s = [int(x) for x in input().split()]
sum = 2
max = 0
if len(s) > 2:
	for i in range(2, len(s)):
		if s[i] == s[i - 1] + s[i - 2]:
			sum += 1
		else:
			sum = 2
		if sum > max:
			max = sum
	print(max)
elif len(s) == 2:
	print(2)
else:
	print(1)


n = int(input())
count = 2
a = [int(x) for x in input().split()]
if n == 1:
	print(1)
elif n == 2:
	print(2)
else:
	maxi = 2
	for i in range(2, n):
		if a[i - 2] + a[i - 1] == a[i]:
			count += 1
		else:
			count = 2
		if maxi < count:
			maxi = count
	print(maxi)


n = int(input())
t = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	p = 0
	o = 0
	for k in range(n - 1, 1, -1):
		if t[k] == t[k - 1] + t[k - 2]:
			p += 1
		else:
			if p > o:
				o = p
			p = 0
	if p > o:
		o = p
	print(o + 2)


n = int(input())
A = list(map(int, input().split()))
if n < 2:
	end = n
	cur = n
	ans = n
else:
	end = 2
	cur = 2
	ans = 2
while end < n:
	if A[end] == A[end - 1] + A[end - 2]:
		cur += 1
	else:
		if ans < cur:
			ans = cur
		cur = 2
	end += 1
if ans < cur:
	ans = cur
print(ans)


n = int(input())
p = input().rstrip().split(' ')
if n == 1 or n == 2:
	print(n)
else:
	A = 2
	mazi = -25288888888
	for i in range(2, len(p)):
		if int(p[i]) == int(p[i - 1]) + int(p[i - 2]):
			A += 1
		else:
			mazi = max(mazi, A)
			A = 2
	mazi = max(mazi, A)
	print(mazi)


n = int(input())
arr = list(map(int, input().split()))
longest = 2
if n <= 2:
	print(n)
	exit()
first = 0
while first < n - 2:
	last = first + 2
	while last < n and arr[last - 2] + arr[last - 1] == arr[last]:
		last += 1
	longest = max(longest, last - first)
	first = last - 1
print(longest)


n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	(max_len, i) = (1, 2)
	while i < n:
		j = i
		count = 2
		while j < n and a[j] == a[j - 1] + a[j - 2]:
			count += 1
			j += 1
		max_len = max(max_len, count)
		i = j
		i += 1
	print(max_len)


def mi():
	return map(int, input().split())
n = int(input())
a = list(mi())
if n <= 2:
	print(n)
	exit(0)
l = 0
r = 2
i = 1
ans = r - l
while r < n:
	if i < n - 1 and a[i] + a[i - 1] == a[i + 1]:
		ans = max(ans, r - l + 1)
		r += 1
		i += 1
	else:
		l = r - 1
		i = r
		r = r + 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
max_d = 0
b = [0] * n
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		b[i] = 1
d = 0
for i in b:
	if i == 1:
		d += 1
	else:
		if d > max_d:
			max_d = d
		d = 0
if d > max_d:
	max_d = d
if n == 1:
	print(1)
else:
	print(max_d + 2)


S = sorted
M = lambda : map(int, input().split())
m = int(input())
a = list(M())
max_seg = 2
ans = 2
for i in range(2, m):
	if a[i] == a[i - 1] + a[i - 2]:
		max_seg += 1
		ans = max(max_seg, ans)
	else:
		max_seg = 2
print(min(ans, len(a)))


n = int(input())
a = list(map(int, input().split()))
max1 = 1
l = r = 0
if n > 1:
	max1 = 2
for i in range(n - 2):
	if a[i] + a[i + 1] == a[i + 2]:
		if l == 0 and r == 0:
			l = i
		r = i + 2
	else:
		if max1 < r - l + 1:
			max1 = r - l + 1
		l = r = 0
if max1 < r - l + 1:
	max1 = r - l + 1
print(max1)


n = int(input())
arr = [int(x) for x in input().split(' ')]
ans = 2
if n < 3:
	ans = n
x = 2
t = 2
while x < n:
	if arr[x - 1] + arr[x - 2] == arr[x]:
		t += 1
		ans = max(ans, t)
	else:
		t = 2
	x += 1
print(ans)


n = map(int, input().split())
a = []
a = list(map(int, input().split()))
m = 0
if len(a) == 1 or len(a) == 2:
	print(len(a))
else:
	win = a[0] + a[1]
	i = 2
	s = 1
	e = 0
	l = 0
	while i < len(a):
		if a[i] == win:
			l += 1
			m = max(l, m)
			s += 1
			win += a[s] - a[e]
			e += 1
			i += 1
		else:
			l = 0
			s += 1
			win += a[s] - a[e]
			e += 1
			i += 1
	print(m + 2)


n = int(input())
a = [int(x) for x in input().split()]
maxL = 0
if len(a) == 1:
	print(1)
elif len(a) == 2:
	print(2)
else:
	l = 0
	for i in range(2, len(a)):
		if a[i] == a[i - 1] + a[i - 2]:
			l += 1
		else:
			maxL = max(l, maxL)
			l = 0
	maxL = max(maxL, l)
	print(maxL + 2)


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
arr = iia()
res = 0
j = 0
for i in range(n):
	if i > 1 and arr[i] != arr[i - 1] + arr[i - 2]:
		res = max(i - j, res)
		j = i - 1
res = max(res, i - j + 1)
print(res)


line = input()
integers = [int(i) for i in line.split()]
n = integers[0]
line = input()
values = [int(i) for i in line.split()]
if n > 1:
	longest = 2
	cur = 2
else:
	longest = 1
	cur = 1
for i in range(len(values) - 2):
	if values[i] + values[i + 1] == values[i + 2]:
		cur += 1
	else:
		if cur > longest:
			longest = cur
		if n > 1:
			cur = 2
		else:
			cur = 1
if cur > longest:
	longest = cur
print(longest)


n = int(input())
A = [int(x) for x in input().split()]
if n <= 2:
	print(n)
	exit()
Index = 2
Max = min(2, n)
while Index < n:
	while Index < n and A[Index] != A[Index - 1] + A[Index - 2]:
		Index += 1
	l = Index
	while Index < n and A[Index] == A[Index - 1] + A[Index - 2]:
		Index += 1
	r = Index - 1
	Lenght = r - l + 3
	Max = max(Max, Lenght)
print(Max)


a = int(input())
h = list(map(int, input().split()))
c = 0
m = c
if a <= 2:
	print(a)
else:
	for i in range(2, a):
		if h[i] == h[i - 1] + h[i - 2]:
			c += 1
		else:
			if m < c:
				m = c
			c = 0
	if m < c:
		m = c
	print(m + 2)


import sys
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
sys.setrecursionlimit(10 ** 7)
mod = 1000000007

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	if n <= 2:
		print(n)
	else:
		l = 2
		maxx = INT_MIN
		for i in range(2, n):
			if a[i] == a[i - 1] + a[i - 2]:
				l += 1
			else:
				l = 2
			maxx = max(l, maxx)
		print(maxx)
try:
	IOE()
except:
	pass
main()


import os
import sys
from atexit import register
from io import BytesIO, StringIO
sys.stdin = StringIO(os.read(0, os.fstat(0).st_size).decode())
sys.stdout = StringIO()
register(lambda : os.write(1, sys.stdout.getvalue().encode()))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())

def main():
	n = ii()
	l = li()
	c = n
	if c > 2:
		c = m = 2
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				m += 1
			else:
				if c < m:
					c = m
				m = 2
		if c < m:
			c = m
	print(c)
main()


import os
import sys
from io import BytesIO, IOBase
import math as M
import itertools as ITR
from collections import defaultdict as D
from collections import Counter as C
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bisect import bisect_left as BL
from bisect import bisect_right as BR
import random as R
import string
import cmath, time
enum = enumerate
start_time = time.time()
MOD = 1000000007
MA = float('inf')
MI = float('-inf')
di8 = ((1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1))
di4 = ((1, 0), (0, 1), (-1, 0), (0, -1))

def increase_stack():
	sys.setrecursionlimit(2 ** 32 // 2 - 1)
	threading.stack_size(1 << 27)
	t = threading.Thread(target=main)
	t.start()
	t.join()

def prints(a):
	print(a, end=' ')

def binary(n):
	return bin(n)[2:]

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def maxfactor(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
	if q:
		return q[-1]

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	l.sort()
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countchar(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def str_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def lis(arr):
	n = len(arr)
	lis = [1] * n
	maximum = 0
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
				maximum = max(maximum, lis[i])
	return maximum

def lcm(arr):
	a = arr[0]
	val = arr[0]
	for i in range(1, len(arr)):
		gcd = gcd(a, arr[i])
		a = arr[i]
		val *= arr[i]
	return val // gcd

def ncr(n, r):
	return M.factorial(n) // (M.factorial(n - r) * M.factorial(r))

def npr(n, r):
	return M.factorial(n) // M.factorial(n - r)

def inint():
	return int(inp())

def inarr():
	return list(map(int, inp().split()))

def invar():
	return map(int, inp().split())

def instr():
	s = inp()
	return list(s)

def insarr():
	return list(inp())
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
inp = lambda : sys.stdin.readline().rstrip('\r\n')
TestCases = 0

def solve():
	n = inint()
	arr = inarr()
	if n == 1:
		print(1)
		return
	if n == 2:
		print(2)
		return
	res = min(2, n)
	c = 0
	ma = 0
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			c += 1
		else:
			ma = max(ma, c)
			c = 0
	ma = max(ma, c)
	print(res + ma)

def main():
	flag = 0
	try:
		sys.stdin = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/input.txt', 'r')
		sys.stdout = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/output.txt', 'w')
	except:
		flag = 1
	t = 1
	if TestCases:
		t = inint()
	for _ in range(1, t + 1):
		solve()
	if not flag:
		print('Time: %.4f sec' % (time.time() - start_time))
		localtime = time.asctime(time.localtime(time.time()))
		print(localtime)
		sys.stdout.close()
main()


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
n = iinput()
a = get_list()
if n == 1 or n == 2:
	print(n)
else:
	ans = 2
	i = 2
	while i < n:
		temp = 2
		while i < n and a[i] == a[i - 1] + a[i - 2]:
			i += 1
			temp += 1
		ans = max(ans, temp)
		i += 1
	print(ans)


n = int(input())
a = [int(x) for x in input().split()]
if n <= 2:
	print(n)
else:
	new = []
	result = -1
	count = 0
	for i in range(2, n):
		if a[i] == a[i - 1] + a[i - 2]:
			count += 1
		else:
			result = max(result, count + 2)
			count = 0
	result = max(result, count + 2)
	print(result)


from sys import stdin, stdout
import bisect

def st():
	return list(stdin.readline())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	n = inp()
	l = li()
	if n == 1:
		pr(1)
	else:
		x = [2]
		le = 2
		for i in range(2, n):
			if l[i] == l[i - 1] + l[i - 2]:
				le += 1
			else:
				x.append(le)
				le = 2
		x.append(le)
		pr(max(x))
solve()


n = int(input())
s = [int(i) for i in input().split()] + [-1]
d = 1
if n == 1:
	print(d)
else:
	r = 2
	cnt = 0
	maxi = 0
	while r <= n:
		if s[r - 1] + s[r - 2] == s[r]:
			cnt += 1
		else:
			maxi = max(cnt, maxi)
			cnt = 0
		r += 1
	print(maxi + 2)


import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
n = ii()
a = li()
t = ans = min(2, n)
for i in range(n - 2):
	if a[i] + a[i + 1] == a[i + 2]:
		t += 1
	else:
		ans = max(ans, t)
		t = 2
print(max(ans, t))


n = int(input())
arr = [int(i) for i in input().split()]
if len(arr) < 3:
	print(len(arr))
else:
	maximum = 2
	count = 0
	for i in range(2, len(arr)):
		if arr[i - 1] + arr[i - 2] == arr[i]:
			count += 1
		else:
			if count + 2 > maximum:
				maximum = count
				maximum += 2
			count = 0
	if count + 2 > maximum:
		maximum = count
		maximum += 2
	print(maximum)


def solve(n, seq):
	longest = 0
	if n == 2:
		return 2
	elif n == 1:
		return 1
	else:
		index = 2
		temp = 2
		while index < n:
			if seq[index] == seq[index - 1] + seq[index - 2]:
				temp += 1
			else:
				if temp > longest:
					longest = temp
				temp = 2
			index += 1
		if temp > longest:
			longest = temp
		return longest
print(solve(int(input()), list(map(int, input().split()))))


n = int(input())
A = list(map(int, input().split()))
if n == 1:
	print(1)
else:
	ans = 2
	run = 0
	for i in range(2, n):
		(a, b) = (A[i - 1], A[i - 2])
		c = A[i]
		if c == a + b:
			if run == 0:
				run = 3
			else:
				run += 1
		else:
			run = 0
		ans = max(run, ans)
	print(ans)


n = int(input())
l = [int(x) for x in input().split()]
x = 0
m = 0
for i in range(2, n):
	if l[i] == l[i - 1] + l[i - 2]:
		x += 1
	else:
		x += 2
		if x > m:
			m = x
		x = 0
x += 2
if x > m:
	m = x
	x = 0
if n <= 2:
	print(n)
else:
	print(m)


n = int(input())
vetor = list(map(int, input().split()))
if len(vetor) <= 2:
	print(len(vetor))
else:
	max_valor = 2
	contador = 2
	i = 2
	while i < len(vetor):
		if vetor[i] == vetor[i - 1] + vetor[i - 2]:
			contador += 1
		else:
			max_valor = max(max_valor, contador)
			contador = 2
		i += 1
	max_valor = max(max_valor, contador)
	print(max_valor)


n = int(input())
arr = [int(i) for i in input().split()]
(myans, pre, i) = (0, 0, 0)
while i < n:
	if i < 2:
		pre += 1
	elif arr[i - 2] + arr[i - 1] == arr[i]:
		pre += 1
	else:
		pre = 2
	myans = max(myans, pre)
	i += 1
print('{0}'.format(myans))


t = int(input())
s = 1
sp = [int(s) for s in input().split()]
max_sum = 2
sum = 2
if t == 1:
	print(1)
else:
	for i in range(2, len(sp)):
		if sp[i] == sp[i - 1] + sp[i - 2]:
			sum += 1
		else:
			max_sum = max(sum, max_sum)
			sum = 2
	max_sum = max(sum, max_sum)
	print(max_sum)


num = int(input())
arr = list(map(int, input().split(' ')))
flag = 2
flag_list = []
if num > 2:
	for i in range(2, num):
		if i != num - 1:
			if arr[i] == arr[i - 1] + arr[i - 2]:
				flag += 1
			else:
				flag_list.append(flag)
				flag = 2
				continue
		else:
			if arr[i] == arr[i - 1] + arr[i - 2]:
				flag += 1
			flag_list.append(flag)
elif num == 1:
	flag_list.append(1)
else:
	flag_list.append(flag)
print(max(flag_list))


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = iinput()
a = list(map(int, input().split()))
l = [2] if n >= 2 else [1]
i = 2
while i < len(a):
	if a[i] == a[i - 1] + a[i - 2]:
		l[-1] = l[-1] + 1
	else:
		l.append(2)
	i += 1
print(max(l))


n = int(input())
num = [int(i) for i in input().split()]
ran = [2] * n
if n > 2:
	for i in range(2, n):
		if num[i] == num[i - 1] + num[i - 2]:
			ran[i] = ran[i - 1] + 1
		else:
			ran[i] = 2
	print(max(ran))
else:
	print(n)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return map(int, input().split())

def array():
	return [int(i) for i in input().split()]
n = int(input())
a = array()
if n <= 2:
	print(n)
	exit()
i = 2
till_len = 2
ans = 2
while i < n:
	if a[i] == a[i - 1] + a[i - 2]:
		till_len += 1
	else:
		ans = max(ans, till_len)
		till_len = 2
	i += 1
print(max(till_len, ans))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def solve():
	(n, arr) = (readint(), readarri())
	if n <= 2:
		print(1 if n == 1 else 2)
		return
	(f1, f2) = (arr[0], arr[1])
	currAns = 2
	buffer = 0
	for i in range(2, n):
		if f1 + f2 == arr[i] and (not buffer):
			buffer += 3
			currAns = max(currAns, buffer)
			f2 = arr[i]
			f1 = arr[i - 1]
			continue
		if f1 + f2 == arr[i] and buffer:
			buffer += 1
			currAns = max(currAns, buffer)
			f2 = arr[i]
			f1 = arr[i - 1]
			continue
		f2 = arr[i]
		f1 = arr[i - 1]
		buffer = 0
	if buffer:
		currAns = max(currAns, buffer)
	print(currAns)

def main():
	t = 1
	for _ in range(t):
		solve()
main()


n = int(input())
list1 = list(map(int, input().strip().split(' ')))
i = 2
l = 2
l1 = 2
while i <= n - 1:
	l = 2
	while list1[i] == list1[i - 1] + list1[i - 2] and i <= n - 1:
		l += 1
		i += 1
		if i > n - 1:
			break
	if l > l1:
		l1 = l
	i += 1
if len(list1) < 2:
	print(len(list1))
else:
	print(l1)


n = int(input())
arr = list(map(int, input().split()))
if n == 1:
	print(1)
else:
	mx = 2
	dp = [2 for i in range(n)]
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			dp[i] = dp[i - 1] + 1
	print(max(dp))


n = int(input())
a = list(map(int, input().split()))
if n <= 2:
	print(n)
else:
	count = 2
	res = 0
	i = 2
	while i < n:
		if a[i] == a[i - 1] + a[i - 2]:
			count += 1
		else:
			res = max(res, count)
			count = 2
		i += 1
	res = max(res, count)
	print(res)


n = int(input())
arr = list(map(int, input().split()))
cc = 2
i = 0
ans = 2
while i < n - 2:
	temp = arr[i]
	temp2 = arr[i + 1]
	temp3 = arr[i + 2]
	if temp + temp2 == temp3:
		cc += 1
		if cc > ans:
			ans = cc
	else:
		cc = 2
	i += 1
if n == 1:
	print(1)
else:
	print(ans)


def main():
	n = int(input())
	seq = [int(c) for c in input().split()]
	cnt = ans = 0
	for i in range(n):
		if cnt < 2:
			cnt += 1
		elif seq[i] == seq[i - 1] + seq[i - 2]:
			cnt += 1
		else:
			cnt = 2
		ans = max(ans, cnt)
	print(ans)
main()


def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	if n <= 2:
		print(n)
		return
	longest = 2
	index = 0
	current = 2
	while index < n - 2:
		if arr[index] + arr[index + 1] == arr[index + 2]:
			current += 1
		else:
			longest = current if current > longest else longest
			current = 2
		index += 1
	longest = current if current > longest else longest
	print(longest)
solve()


n = int(input())
ar = list(map(int, input().split()))
if len(ar) == 1:
	print(1)
elif len(ar) == 2:
	print(2)
else:
	res = 2
	start = 0
	end = -1
	fib1 = ar[0]
	fib2 = ar[1]
	end = 1
	for i in range(2, len(ar)):
		if fib1 + fib2 == ar[i]:
			end = i
			fib1 = fib2
			fib2 = ar[i]
		else:
			if end - start + 1 > res:
				res = end - start + 1
			fib1 = ar[i - 1]
			fib2 = ar[i]
			start = i - 1
			end = i
	if end - start + 1 > res:
		res = end - start + 1
	print(res)


L = lambda : list(map(int, input().split()))
I = lambda : int(input())
(n, t) = (I(), L())
k = s = i = 2
while i < n:
	if t[i] == t[i - 1] + t[i - 2]:
		s += 1
	else:
		(k, s) = (max(k, s), 2)
	i += 1
print(max(k, s) - int(n == 1))


n = int(input())
a = [int(i) for i in input().split()]
b = [False, False]
for i in range(2, n):
	if a[i] == a[i - 1] + a[i - 2]:
		b.append(True)
	else:
		b.append(False)
max = 0
now = 0
for i in b:
	if i:
		now += 1
	else:
		if now > max:
			max = now
		now = 0
if now > max:
	max = now
print(min(n, max + 2))


i = int(input())
sayilar = list(map(int, input().split()))
miin = 0
count = 0
if len(sayilar) <= 2:
	if len(sayilar) == 2:
		print(2)
	elif len(sayilar) == 1:
		print(1)
	else:
		print(0)
else:
	for i in range(2, len(sayilar)):
		if sayilar[i] == sayilar[i - 1] + sayilar[i - 2]:
			count += 1
			if count > miin:
				miin = count
		else:
			count = 0
	print(miin + 2)


n = int(input())
a = list(map(int, input().split()))
(m, l) = (0, 1)
for x in range(n - 2):
	if a[x + 2] == a[x] + a[x + 1]:
		l += 1
	else:
		m = max(m, l)
		l = 1
m = max(m, l)
print(min(m + 1, n))


n = int(input())
arr = list(map(int, input().split()))
s = 2
m = 2
for i in range(2, n):
	if arr[i - 1] + arr[i - 2] == arr[i]:
		s += 1
		if s > m:
			m = s
	else:
		s = 2
if n == 1 or n == 2:
	print(n)
else:
	print(m)


n = int(input())
l = list(map(int, input().split()))
ans = 2
if n < 3:
	ans = n
x = 2
t = 2
while x < n:
	if l[x - 1] + l[x - 2] == l[x]:
		t += 1
		ans = max(ans, t)
	else:
		t = 2
	x += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
M = 2
c = 2
if n == 1:
	print(1)
else:
	for i in range(n - 2):
		if arr[i] + arr[i + 1] == arr[i + 2]:
			c += 1
		else:
			if c > M:
				M = c
			c = 2
	print(max(M, c))


n = int(input())
arr = list(map(int, input().split(' ')))
if n <= 2:
	print(n)
else:
	final = [0] * n
	counter = [0] * n
	for i in range(2, n):
		if arr[i] == arr[i - 1] + arr[i - 2]:
			final[i] = 1
	for i in range(n):
		if final[i] == 1:
			counter[i] = counter[i - 1] + 1
		else:
			counter[i] = 0
	a = max(counter)
	print(a + 2)


import sys
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
n = int(data())
arr = l()
dp = dict()
for i in range(2, n):
	if arr[i] == arr[i - 1] + arr[i - 2]:
		dp[i] = 1
		continue
	dp[i] = 0
if len(arr) == 1:
	out('1')
	exit()
answer = 0
cnt = 0
for i in range(2, n):
	if not dp[i]:
		cnt = 0
		continue
	cnt += 1
	answer = max(answer, cnt)
answer = max(answer, cnt)
if answer > 0:
	out(str(answer + 2))
	exit()
out('2')
exit()


from collections import Counter
n = int(input())
l = list(map(int, input().split()))
r = []
i = 2
a = 0
while i < n:
	if l[i] == l[i - 1] + l[i - 2]:
		a += 1
	else:
		r += [a]
		a = 0
	i += 1
r += [a]
if len(l) == 1:
	print('1')
elif len(r) != 0:
	print(2 + max(r))
else:
	print('2')


n = int(input())
arr = [int(i) for i in input().split()]
res = 0
i = 2
if n > 2:
	while i < n:
		temp = 2
		while i < n and arr[i] == arr[i - 1] + arr[i - 2]:
			temp += 1
			i += 1
		i += 1
		res = max(res, temp)
else:
	res = n
print(res)


n = int(input())
array = list(map(int, input().split()))
if n == 1:
	print(1)
else:
	dp = [1 for _ in range(n)]
	dp[1] = 2
	for i in range(2, n):
		if array[i] == array[i - 1] + array[i - 2]:
			dp[i] = dp[i - 1] + 1
		else:
			dp[i] = 2
	print(max(dp))


def segment(lst):
	b = [False, False]
	for i in range(2, len(lst)):
		if lst[i] == lst[i - 1] + lst[i - 2]:
			b.append(True)
		else:
			b.append(False)
	(maximum, current) = (0, 0)
	for elem in b:
		if elem:
			current += 1
		else:
			if current > maximum:
				maximum = current
			current = 0
	if current > maximum:
		maximum = current
	return min(len(lst), maximum + 2)
n = int(input())
a = [int(j) for j in input().split()]
print(segment(a))


n = int(input())
idx = ans = c = 0
for i in input().split():
	i = int(i)
	if idx == 0:
		first = i
	elif idx == 1:
		last = i
	else:
		if first + last == i:
			c += 1
		else:
			ans = max(ans, c)
			c = 0
		(first, last) = (last, i)
	idx += 1
ans = max(ans, c)
if ans == 0:
	print([2, 1][n == 1])
else:
	print(ans + 2)