#include<bits/stdc++.h>
using namespace std;
int c[10001]={0};
int main()
{
    bool ok=true;
    int n,i,mx_so_far=1,mx_h=1;
    memset(c,-1,sizeof(c));
    cin>>n;
    int a[n];
    c[0]=0;
    for(i=0;i<n;i++)
    {
    cin>>a[i];
    if(i>1)
        if(a[i-1]+a[i-2]==a[i])
            c[i]=1;
    }
    for(i=2;i<n;i++)
    {
        mx_h += c[i];
        if(mx_h<0)
            {
            mx_h=0;
            ok=false;
            }
        mx_so_far=max(mx_so_far,mx_h);
    }
    cout<<max(mx_so_far+ok+1,n==1?1:2)<<endl;
    return 0;

}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    int m=0;
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
        c[i]=2;
    }
    if(a<=2)    cout<<a<<endl;

    else
    {
        for(int i=2;i<a;i++)
        {

            if(b[i]==b[i-1]+b[i-2]) c[i]=c[i-1]+1;
            else c[i]=c[i-1];
            m=max(m,c[i]);
        }
        cout<<m<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000];
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
    }
    int l=2;
    for(int i=2;i<a;i++)
    {
        if(b[i]==b[i-1]+b[i-2])
        {
            l++;
        }
    }
    cout<<l<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    int m=0;
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
        c[i]=2;
    }
    if(a<=2)    cout<<a<<endl;

    else
    {
        for(int i=2;i<a;i++)
        {

            if(b[i]==b[i-1]+b[i-2]) c[i]=c[i-1]+1;
            else c[i]=2;
            m=max(m,c[i]);
        }
        cout<<m<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    memset(c,0,sizeof c);
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
    }
    int l=2;
    c[0]=c[1]=1;
    for(int i=2;i<a;i++)
    {
        if(b[i]==b[i-1]+b[i-2]&&c[i-1]==1&&c[i-2]==1)
        {
            c[i]=1;
            l++;
        }
    }
    cout<<l<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    memset(c,0,sizeof c);
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
    }
    if(a<=2)    cout<<a<<endl;
    else
    {
        int l=2;
        c[0]=c[1]=1;
        int m=0;
        for(int i=2;i<a;i++)
        {
            l=2;
            for(int j=i;j<a;j++)
            {
                if(b[i]==b[i-1]+b[i-2]&&c[i-1]==1&&c[i-2]==1)
                {
                    c[i]=1;
                    l++;
                }
                else break;

            }
            m=max(l,m);
        }
        cout<<m<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    int m=0;
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
        c[i]=2;
    }
    if(a<=2)    cout<<a<<endl;
    else
    {
        for(int i=2;i<a;i++)
        {

            if(b[i]==b[i-1]+b[i-2]) c[i]=c[i-1]+1;
            else c[i]=c[i-1];
        }

        cout<<c[a-1]<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    int b[110000],c[110000];
    memset(c,0,sizeof c);
    for(int i=0;i<a;i++)
    {
        scanf("%d",&b[i]);
    }
    if(a<=2)    cout<<a<<endl;
    else
    {
        int l=2;
        c[0]=c[1]=1;
        for(int i=2;i<a;i++)
        {
            if(b[i]==b[i-1]+b[i-2]&&c[i-1]==1&&c[i-2]==1)
            {
                c[i]=1;
                l++;
            }
        }
        cout<<l<<endl;
    }
    return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,ncount,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }

                                if(n==1){
                                                printf("1\n");
                                                continue;
                                }

                                ans=0,Max=0;
                                for(int  i=1;i<n;i++)
                                {
                                        ans=1;

                                        if(a[i]<=a[i+1])
                                        {
                                                ans=2;
                                                ncount=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])ncount++;
                                                        else break;
                                                }
                                                //printf("%d\n",ncount);
                                                ans+=ncount;
                                        }
                                        //printf("Max=%d\tans=%d\n",Max,ans);
                                        if(Max<=ans)Max=ans;
                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,count,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }

                                for(int  i=1;i<=n;i++)
                                {
                                        ans=1;
                                        Max=0;
                                        if(i+1<n&&a[i]<=a[i+1])
                                        {
                                                ans++;
                                                count=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])count++;
                                                        else break;
                                                }
                                                ans+=count;
                                        }
                                        if(Max<ans)Max=ans;

                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,ncount,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }

                                if(n==1){
                                                printf("1\n");
                                                continue;
                                }

                                ans=0,Max=0;
                                for(int  i=1;i<n;i++)
                                {
                                        ans=1;

                                        if(a[i]<=a[i+1])
                                        {
                                                ans=2;
                                                ncount=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])ncount++;
                                                        else break;
                                                }
                                                i+=ncount;
                                                //printf("%d\n",ncount);
                                                ans+=ncount;
                                        }
                                        //printf("Max=%d\tans=%d\n",Max,ans);
                                        if(Max<=ans)Max=ans;
                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,ncount,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }

                                if(n==1){
                                                printf("1\n");
                                                continue;
                                }

                                ans=0,Max=0;
                                for(int  i=1;i<=n;i++)
                                {
                                        ans=1;

                                        if(a[i]<=a[i+1])
                                        {
                                                ans=2;
                                                ncount=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])ncount++;
                                                        else break;
                                                }
                                                i+=ncount;
                                                //printf("%d\n",ncount);
                                                ans+=ncount;
                                        }
                                        //printf("Max=%d\tans=%d\n",Max,ans);
                                        if(Max<=ans)Max=ans;
                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#include<iostream>
using namespace std;
#define size 100009
int n;
__int64 a[size];
int main()
{
                while(~scanf("%d",&n))
                {
                        if(n==1|| n==2)
                        {
                                printf("%d\n",n);
                                continue;
                        }
                        for(int i=1;i<=n;i++)
                                scanf("%I64d",&a[i]);
                        a[0]=0;
                        int ans=0,Max=-1;
                        for(int i=2;i<=n;i++)
                        {
                                if(a[i-1]+a[i-2]==a[i])ans++;
                                else ans=0;
                                if(Max<ans)Max=ans;
                        }
                        printf("%d\n",ans+2);
                }
                return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,count,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }
                                ans=0,Max=0;
                                for(int  i=1;i<n;i++)
                                {
                                        ans=1;
                                        if(a[i]<=a[i+1])
                                        {
                                                ans++;
                                                count=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])count++;
                                                        else break;
                                                }
                                                ans+=count;
                                        }
                                        if(Max<ans)Max=ans;
                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#define size 100009
__int64 a[size];
int n,ncount,ans,Max;
int main()
{
                while(~scanf("%d",&n))
                {
                                for(int i=1;i<=n;i++)
                                {
                                                scanf("%I64d",&a[i]);
                                }

                                if(n==1){
                                                printf("1\n");
                                                continue;
                                }

                                ans=0,Max=0;
                                for(int  i=1;i<n;i++)
                                {
                                        ans=1;

                                        if(a[i]<=a[i+1])
                                        {
                                                ans=2;
                                                ncount=0;
                                                for(int j=i+2;j<=n;j++)
                                                {
                                                        if(a[j]==a[j-1]+a[j-2])ncount++;
                                                        else break;
                                                }
                                                i=i+(ncount+1);
                                                //printf("%d\n",ncount);
                                                ans+=ncount;
                                        }
                                        //printf("Max=%d\tans=%d\n",Max,ans);
                                        if(Max<=ans)Max=ans;
                                }
                                printf("%d\n",Max);
                }
                return 0;
}


#include<stdio.h>
#include<iostream>
using namespace std;
#define size 100009
int n;
__int64 a[size];
int main()
{
                while(~scanf("%d",&n))
                {

                        for(int i=0;i<n;i++)
                                scanf("%I64d",&a[i]);

                        if(n==1|| n==2)
                        {
                                if(n==1)printf("%d\n",n);
                                else if(a[1]>a[0])printf("1\n");
                                else printf("2\n");
                                continue;
                        }
                        int ans=0,Max=0,count=0;
                        for(int i=2;i<n;i++)
                        {

                                if(a[i-1]+a[i-2]==a[i])
                                {
                                        ans++;
                                         if(Max<ans)Max=ans;
                                }
                                else ans=0;

                        }
                        //printf("ans==%d\n",ans);
                        if(Max==0)
                        {
                                int flag1=0;
                                for(int i=1;i<n;i++)
                                {
                                                if(a[i]>=a[i-1])flag1=1;

                                }
                               // printf("mark\n");
                                if(flag1)printf("2\n");
                                else printf("1\n");
                               // printf("%d\n",ans+count);
                        }
                        else printf("%d\n",Max+2);

                }
                return 0;
}


#include<stdio.h>
#define size 100000
__int64 a[size+9];
int n;
int len;
int main()
{
        while(~scanf("%d",&n))
        {
                int max=(n>=2)?2:n;

                for(int i=0;i<n;i++)
                {
                        scanf("%I64d",&a[i]);
                        if(i>=2 && a[i]==a[i-1]+a[i-2])
                        {
                                        len++;
                                        if(len>max)max=len;
                        }
                        else len=2;
                }
                printf("%d\n",max);
        }
        return 0;
         }


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, cur=2;
	std::cin >> n;
	if(n<=2)
		std::cout << n << std::endl;
	else
	{
		std::cin >> a;
		std::cin >> b;
		for(llu i=2;i<n;++i)
		{
			std::cin >> c;
			if(c==a+b)
			{
				++cur;
				a=b;
				b=c;
			}
			else
			{
				if(res<cur)
					res=cur;
				cur=2;
				a=c;
				if(++i<n)
				{
					std::cin >> b;
				}
			}
		}
		res=std::max(res,cur);
		std::cout << res << std::endl;
	}
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, max=2;
	std::cin >> n;
	std::cin >> a;
	std::cin >> b;
	for(llu i=2;i<n;++i)
	{
		std::cin >> c;
		if(c==a+b)
		{
			++max;
			a=b;
			b=c;
		}
		else if(i+2<n)
		{
			if(res<max)
				res=max;
			max=2;
			std::cin >> a;
			std::cin >> b;
		}
	}
	std::cout << std::max(res,max) << std::endl;
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, max=2;
	std::cin >> n;
	if(n<=2)
		std::cout << n << std::endl;
	std::cin >> a;
	std::cin >> b;
	for(llu i=2;i<n;++i)
	{
		std::cin >> c;
		if(c==a+b)
		{
			++max;
			a=b;
			b=c;
		}
		else if(i+1<n)
		{
			if(res<max)
				res=max;
			max=2;
			a=c;
			std::cin >> b;
			++i;
		}
	}
	std::cout << std::max(res,max) << std::endl;
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, cur=2;
	std::cin >> n;
	if(n<=2)
		std::cout << n << std::endl;
	else
	{
		std::cin >> a;
		std::cin >> b;
		for(llu i=2;i<n;++i)
		{
			std::cin >> c;
			if(c==a+b)
			{
				++cur;
				a=b;
				b=c;
			}
			else if(i+1<n)
			{
				if(res<cur)
					res=cur;
				cur=2;
				a=c;
				std::cin >> b;
				++i;
			}
			else
			{
				cur=1;
			}
		}
		res=std::max(res,cur);
		std::cout << res << std::endl;
	}
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, max=2;
	std::cin >> n;
	std::cin >> a;
	std::cin >> b;
	for(llu i=2;i<n;++i)
	{
		std::cin >> c;
		if(c==a+b)
		{
			++max;
			a=b;
			b=c;
		}
		else if(i+1<n)
		{
			if(res<max)
				res=max;
			max=2;
			a=c;
			std::cin >> b;
			++i;
		}
	}
	std::cout << std::max(res,max) << std::endl;
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, max=2;
	std::cin >> n;
	if(n<=2)
		std::cout << n << std::endl;
	else
	{
		std::cin >> a;
		std::cin >> b;
		for(llu i=2;i<n;++i)
		{
			std::cin >> c;
			if(c==a+b)
			{
				++max;
				a=b;
				b=c;
			}
			else if(i+1<n)
			{
				if(res<max)
					res=max;
				max=2;
				a=c;
				std::cin >> b;
				++i;
			}
		}
		std::cout << std::max(res,max) << std::endl;
	}
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n;
	std::cin >> n;
	if(n<=2)
	{
		std::cout<<n<<std::endl;
		return 0;
	}
	std::vector<llu> a(n,0);
	for(llu i=0;i<n;++i)
		std::cin >> a[i];
	llu l=0,r=2,res=0;
	for(;r<n;++r)
	{
		if(a[r-2]+a[r-1]!=a[r])
		{
			res=std::max(r-l,res);
			l=r-1;
		}
	}
		res=std::max(res,r-l);
		std::cout << res << std::endl;
	return 0;
}


#include <vector>
#include <iostream>
#include <stdio.h>

typedef unsigned long long llu;

int main()
{
	llu n, a, b, c, res=0, max=2;
	std::cin >> n;
	std::cin >> a;
	std::cin >> b;
	for(llu i=2;i<n;++i)
	{
		std::cin >> c;
		if(c==a+b)
		{
			++max;
			a=b;
			b=c;
		}
		else if(i+2<n)
		{
			if(res<max)
				res=max;
			std::cin >> a;
			std::cin >> b;
		}
	}
	std::cout << std::max(res,max) << std::endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=0;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
double b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long a[100007];
int main() {
	long long  n,i,it=0,m=-1;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])it++;
	else {if(it>m){m=it;it=0;}}
	if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100007],a[100007];
int main() {
	long long  n,i,it=0,m=-1;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]-a[i-1]==a[i-2])it++;else {if(it>m){m=it;it=0;}}

	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long a[100007];
int main() {
	long long  n,i,it=2,m=-1;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])it++;
	else {if(it>m){m=it;it=2;}}
	if(it>m)m=it;
	 cout<<m<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
double b[100007],a[100007];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=0;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int b[100001],a[100001];
int main() {
	int n,i;
	cin>>n;
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	int m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m)m=it;it=0;}
	 if(it>m)m=it;
	 cout<<m+2<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2]){b[i]=1;}
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 if(m<3)cout<<m<<endl;else cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100007],a[100007];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=2;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
__int64 b[100007],a[100007];
int main() {
	__int64  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]-a[i-1]==a[i-2])b[i]=1;
	__int64 m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=2;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
double b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m+2<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2]){b[i]=1;b[i-1]=1;b[i-2]=1;}
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=0;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 cout<<m<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
double b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m)m=it;it=0;}
	 if(it>m)m=it;
	 cout<<m+2<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m)m=it;it=0;}
	 if(it>m)m=it;
	 cout<<m+2<<endl;
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2])b[i]=1;
	double m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m)m=it;it=0;}
	 if(it>m)m=it;
	 cout<<m+2<<endl;}
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long b[100001],a[100001];
int main() {
	long long  n,i;
	cin>>n;
	if(n<3)cout<<n<<endl;else {
	for(i=0;i<n;i++)cin>>a[i];
	for(i=2;i<n;i++)
	if(a[i]==a[i-1]+a[i-2]){b[i]=1;}
	long long m=-1,it=0;
//	for(i=0;i<n;i++)
//cout<<b[i]<<" ";
//cout<<endl;
	for(i=0;i<n;i++)
	 if(b[i]==1)it++;else {if(it>m){m=it;it=0;}}
	 if(it>m)m=it;
	 if(m<3)cout<<m+2<<endl;else cout<<m+2<<endl;}
	return 0;
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    int m=2;
    int len=2;
    cin>>n;
    if(n==1||n==2)
    {
        cout<<n<<endl;
        for(int i=0;i<n;++i) cin>>a[i];
    }
    else
    {

        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            if(a[i]==a[i-1]+a[i-2]) ++len;
            else
            {
                ++i;
                len=2;
                break;
            }
        }
        m=max(m,len);
    }
    cout<<m<<endl;
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    int m=2;
    bool zz=true;
    int len=2;
    cin>>n;
    if(n==1||n==2)
    {
        zz=false;
        for(int i=0;i<n;++i) cin>>a[i];
        cout<<n<<endl;
    }
    else
    {
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            if(a[i]==a[i-1]+a[i-2]) ++len;
            else
            {
                len=2;
                continue;
            }
        }
        m=max(m,len);
    }
    if(zz) cout<<m<<endl;
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    cin>>n;
    if(n==1||n==2) cout<<n<<endl;
    else
    {
        int m=2;
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            int len=2;
            for(int j=i;j<n;++j)
            {
                if(a[j]==a[j-1]+a[j-2]) ++len;
                else
                {
                    i=j+1;
                    break;
                }
            }
            m=max(m,len);
        }
        cout<<m<<endl;
    }
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    int m=2;
    int len=2;
    cin>>n;
    if(n==1||n==2)
    {
        cout<<n<<endl;
        for(int i=0;i<n;++i) cin>>a[i];
    }
    else
    {
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            if(a[i]==a[i-1]+a[i-2]) ++len;
            else
            {
                len=2;
                break;
            }
        }
        m=max(m,len);
    }
    cout<<m<<endl;
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    cin>>n;
    if(n==1||n==2) cout<<n<<endl;
    else
    {
        int m=2;
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            int len=2;
            for(int j=i;j<n;++j)
            {
                if(a[j]==a[j-1]+a[j-2]) ++len;
                else break;
            }
            m=max(m,len);
        }
        cout<<m<<endl;
    }
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    int m=2;
    int len=2;
    cin>>n;
    if(n==1||n==2)
    {
        cout<<n<<endl;
        for(int i=0;i<n;++i) cin>>a[i];
    }
    else
    {
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            if(a[i]==a[i-1]+a[i-2]) ++len;
            else
            {
                len=2;
                continue;
            }
        }
        m=max(m,len);
    }
    cout<<m<<endl;
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    cin>>n;
    if(n==1||n==2) cout<<n<<endl;
    else
    {
        int m=2;
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            int len=2;
            for(int j=i;j<n;++j)
            {
                if(a[j]==a[j-1]+a[j-2]) ++len;
                else
                {
                    i=j;
                    break;
                }
            }
            m=max(m,len);
        }
        cout<<m<<endl;
    }
    //system("pause");
}


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
    int n,a[100010];
    int m=2;
    bool zz=true;
    int len=2;
    cin>>n;
    if(n==1||n==2)
    {
        zz=false;
        for(int i=0;i<n;++i) cin>>a[i];
        cout<<n<<endl;
    }
    else
    {
        for(int i=0;i<n;++i) cin>>a[i];
        for(int i=2;i<n;++i)
        {
            if(a[i]==a[i-1]+a[i-2]) ++len;
            else
            {
                m=max(m,len);
                len=2;
            }
            if(i==n-1) m=max(m,len);
        }
    }
    if(zz) cout<<m<<endl;
    //system("pause");
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (!in_seg) l = i;
    max = (len(l, i) > max) ? len(l, i) : max;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (!in_seg) l = i;
    if (in_seg) max = (len(l, i) > max) ? len(l, i) : max;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (!in_seg) l = i;
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (in_seg) max = (len(l, i) > max) ? len(l, i) : max;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (!in_seg) l = i;
    else max = (len(l, i) > max) ? len(l, i) : max;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (!in_seg) l = i;
    max = (len(l, i) > max) ? len(l, i) : max;
  }
  if (in_seg) max = (len(l, r) > max) ? len(l, r) : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (!in_seg) l = i;
    max = (len(l, r) > max) ? len(l, r) : max;
    r = i;
  }
  if (in_seg) max = (len(l, r) > max) ? len(l, r) : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2, r = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (len(l, r) > max) ? len(l, r) : max;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) in_seg = true;
      l = i;
    }
    r = i;
  }
  if (in_seg) max = (len(l, r) > max) ? len(l, r) : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, lo = 2, hi = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
      } else {
        hi = i;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) in_seg = true;
      lo = i;
      hi = i;
    }
  }
  if (in_seg) max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2;
  for (int i = 2; i < n; ++i) {
    if (!in_seg) l = i;
    if (!in_seg && a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    if (in_seg && a[i] != a[i - 1] + a[i - 2]) in_seg = false;
    if (in_seg) max = (len(l, i) > max) ? len(l, i) : max;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, lo = 2, hi = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) in_seg = true;
      lo = i;
    }
    hi = i;
  }
  if (in_seg) max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, l = 2, r = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (len(l, r) > max) ? len(l, r) : max;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) in_seg = true;
      l = i;
    }
    r = i;
  }
  if (in_seg) max = (len(l, r) > max) ? len(l, r) : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  int lo, hi;
  int max_len = 0;
  bool in_seg = false;
  for (int i = 2; i < n; ++i) {
    if (!in_seg) {
      lo = i;
      hi = i;
      if (a[i] == a[i - 1] + a[i - 2]) in_seg = true;
    } else {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        if (hi - lo + 1 > max_len) max_len = hi - lo + 1;
      } else hi = i;
    }
  }
  if (hi == n - 1 && hi - lo + 1 > max_len) max_len = hi - lo + 1;
  return max_len + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

inline int len(int l, int r) {
  return r - l + 1;
}

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0;
  for (int l = 2, r = 2; r < n; ++r) {
    if (!in_seg) l = r;
    if (in_seg && a[r] != a[r - 1] + a[r - 2]) in_seg = false;
    if (!in_seg && a[r] == a[r - 1] + a[r - 2]) in_seg = true;
    if (in_seg) max = (len(l, r) > max) ? len(l, r) : max;
  }
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  bool in_seg = false;
  int max = 0, lo = 2, hi = 2;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
      } else {
        hi = i;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) {
        in_seg = true;
        lo = i;
      } else {
        lo = i;
        hi = i;
      }
    }
  }
  if (in_seg) max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int FindLongestSeg(int* a, int n) {
  if (n <= 2) return n;
  int max = 0, lo = 0, hi = 0;
  bool in_seg = false;
  for (int i = 2; i < n; ++i) {
    if (in_seg) {
      if (a[i] != a[i - 1] + a[i - 2]) {
        in_seg = false;
        max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
      } else {
        hi = i;
      }
    } else {
      if (a[i] == a[i - 1] + a[i - 2]) {
        in_seg = true;
        lo = i;
      } else {
        lo = i;
        hi = i;
      }
    }
  }
  if (in_seg) max = (hi - lo + 1 > max) ? hi - lo + 1 : max;
  return max + 2;
}

int main() {
  int n;
  int a[100000 + 10];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  cout << FindLongestSeg(a, n) << endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            //cout<<p<<" "<<q<<"\n";
            m=max(m,r);p=i+1;
        }
    }
    if(q>=p)
    m=max(m,q-p+1);
    if(m==0)
        {
            if(n==1)
                cout<<1;
            else
                cout<<2;
        }
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            //cout<<p<<" "<<q<<"\n";
            m=max(m,r);p=i+1;
        }
    }
    if(q>=p)
    m=max(m,q-p+1);
    if(m==0)
        cout<<2;
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[20005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            m=max(m,r);p=i;
        }
    }
    m=max(m,q-p+1);
    if(m==0)
        cout<<2;
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=3;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            m=max(m,r);p=i+1;
        }
    }
    m=max(m,q-p+1);
    if(m==0)
        {
            if(n==1)
                cout<<1;
            else
                cout<<2;
        }
    else
        cout<<m+2;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[20005],p;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        {
            c++;
            if(c==1)
                p=i;
        }
        else
        {
            if(c>m)
            {
                m=c;c=0;
            }
        }
    }
    if(c>m)
    {
        m=c;
    }
    if(m==0)
        cout<<2;
    else if(p==3)
        cout<<m+2;
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[20005],p;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        {
            c++;
            if(c==1)
                p=i;
        }
        else
        {
            if(c>m)
            {
                m=c;c=0;q=p;
            }
        }
    }
    if(c>m)
    {
        m=c;q=p;
    }
    if(m==0)
      {
          if(n<=2)
            cout<<n;
            else
                cout<<2;

      }
    else if(q==3)
        cout<<m+2;
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            m=max(m,r);p=i+1;
        }
    }
    m=max(m,q-p+1);
    if(m==0)
        cout<<2;
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            m=max(m,r);p=i+1;
        }
    }
    m=max(m,q-p+1);
    if(m==0)
        {
            if(n==1)
                cout<<1;
            else
                cout<<2;
        }
    else
        cout<<m;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,char>pii;
ll i,j,m,n,q,r,s,c,l,a[200005],p=1;
vector<pii>v;
map<ll,ll>mp;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=3;i<=n;i++)
    {
        if(a[i]==a[i-1]+a[i-2])
        q=i;
        else
        {
            r=q-p+1;
            m=max(m,r);p=i;
        }
    }
    m=max(m,q-p+1);
    if(m==0)
        cout<<2;
    else
        cout<<m;

}


#include <iostream>
#include <stdio.h>
using namespace std;
long a[1000001],n;
void nhap()
{

    cin>>n;
    for (long i=0;i<n;i++)
    cin>>a[i];
}

void ghi()
{
    if (n<1) cout<<0;
    if (n<2)  cout<<1;
    else
    {
long    i=0,Max =2;
    while (i<n)
    {
        long count = 2;
        long j=i+2;
        while (j<n)
        {

            if(a[j]==a[j-1]+a[j-2]) count++;

              if (count > Max) Max=count;
               j++;
        }
        i++;
    }
    cout<<Max;
    }
}
main()
{
    nhap();
    ghi();

}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
	int n,d=1,max=1;
	long long a[100001];
	cin>>n;
	a[0]=0;
	for (int i=1;i<=n;i++)
	{
		cin>>a[i];
		if (i>1)
		{
			if (a[i]==a[i-1]+a[i-2]) d++;
			else
			if (d>max)
			{
				max=d;
				d=1;
			}
		}
	}
	if (d>max) max=d;
	cout<<max;
}


#include<iostream>
using namespace std;
int main(){
    long long n,a[1000005];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    long long d=2,max=0;
    for(int i=0;i<n-2;i++){
        if(a[i+2]==a[i]+a[i+1]){
            d++;
            max=d;
        }
        else d=2;
    }
    if(max<d) max=2;
    if(n==1) max=1;
    cout<<max;
}


using namespace std;
int main(){
    int n,a[10000];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    int d=2,max=0;
    for(int i=0;i<n-2;i++){
        if(a[i+2]==a[i]+a[i+1]){
            d++;
            max=d;
        }
        else d=2;
    }
    if(max<d) max=2;
    if(n==1) max=1;
    cout<<max;
}


#include <fstream>
#include <stdio.h>
#include <iostream>
using namespace std;
long a[1000000],n;
void nhap()
{

    cin>>n;
    for (long i=0;i<n;i++)
    cin>>a[i];
}

void ghi()
{

    if (n<1) {
            cout<<0;
            return;
                }
    if (n<2)
    {
     cout<<1;
     return;
    }
    else
    {

     long  Max =2;
        long count = 2;
        long j=2;
        while (j<n)
        {

            if(a[j]==a[j-1]+a[j-2]) count++;
             if (count > Max) Max=count;

               j++;
        }

    cout<<Max;
   }
}
main()
{
    nhap();
    ghi();

}


#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
	int n,d=1,max=1;
	long long a[100001];
	cin>>n;
	a[0]=0;
	for (int i=1;i<=n;i++)
	{
		cin>>a[i];
		if (i>1)
		{
			if (i==2){
				if (a[i]==a[i-1]||a[i]==a[i-1]+1) d++;}
			else if (a[i]==a[i-1]+a[i-2]) d++;
			else
			if (d>max)
			{
				max=d;
				d=1;
			}
		}
	}
	if (d>max) max=d;
	cout<<max;
}


#include<iostream>
using namespace std;
int main(){
    int n,a[10000];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    int d=2,max=0;
    for(int i=0;i<n-2;i++){
        if(a[i+2]==a[i]+a[i+1]){
            d++;
            max=d;
        }
        else d=2;
    }
    if(max<d) max=2;
    if(n==1) max=1;
    cout<<max;
}


#include<iostream>
using namespace std;

long long len = 0;

long long test(long a[],long long n)
{
    int i,j,temp;
    if(n == 1 || n == 2)
        return n;
    for(i = 0; i < n-1; i++)

    {
        temp = i;
        j = i + 2;
        while(a[i]+a[i+1] == a[j])
        {
            i++;
            j++;
        }
        len = j - temp;
    }
    return len;
}

int main(void)
{
    long long n;
    cin>>n;
    long a[n+2];
    for(long long i = 0; i < n; i++)
        cin>>a[i];
    cout<<endl;
    cout<<test(a,n);
}


#include<iostream>
using namespace std;

long long len = 0;

long long test(long a[],long long n)
{
    int i,j,temp;
    if(n == 1 || n == 2)
        return n;
    for(i = 0; i < n; i++)
    {
        temp = 2;
        j = i + 2;
        while(a[i]+a[i+1] == a[j] && j < n)
        {
            i++;
            j++;
            temp++;
        }
        if(temp > len)
            len = temp;
    }
    return len;
}

int main(void)
{
    long long n;
    cin>>n;
    long a[n+2];
    for(long long i = 0; i < n; i++)
        cin>>a[i];
    cout<<endl;
    cout<<test(a,n);
}


#include<iostream>
long long  a[1000010];
using namespace std;
int main(){
    long n,d=2,max=0;
    cin>>n;
    for(int  i=0;i<n;i++)
        cin>>a[i];
    for(int i=2;i<n;i++){
        if(a[i]==a[i-1]+a[i-2]){
            d++;
            if(d>max)max=d;
        }
        else d=2;
    }
    if(max<d) max=2;
    if(n<=2) max=n;
    cout<<max;
}


#include<stdio.h>
int nhap(long a[],long &n){
        scanf("%ld",&n);
    for(int i=0;i<n;i++){
        scanf("%ld",&a[i]);
    }
}
int tinh(long  a[],long n){
    long long s,d=2,max=0;
    if(n==1) printf("%d",1);
    if(n==2) printf("%d",2);
    for(int i=2;i<n;i++)
    if(a[i]==a[i-1]+a[i-2]){
        d++;
        if(d>max) max=d;
    }else{
        d=2;
    }
    if(d>max) max=d;
        printf("%d",max);
}
int main(){
    long  a[1000005],n;
    nhap(a,n);
    tinh(a,n);
}


#include<stdio.h>
int nhap(long a[],long &n){
        scanf("%ld",&n);
    for(int i=0;i<n;i++){
        scanf("%ld",&a[i]);
    }
}
int tinh(long  a[],long n){
    long long s,d=2,max=0;
    if(n==1) { printf("%d",1); return 0;}
    if(n==2) {printf("%d",2);return 0;}
    for(int i=2;i<n;i++)
    if(a[i]==a[i-1]+a[i-2]){
        d++;
        if(d>max) max=d;
    }else{
        d=2;
    }
    if(d>max) max=d;
        printf("%d",max);
}
int main(){
    long  a[1000005],n;
    nhap(a,n);
    tinh(a,n);
}


#include <iostream>
#include <stdio.h>
using namespace std;
long a[1000001],n;
void nhap()
{

    cin>>n;
    for (long i=0;i<n;i++)
    cin>>a[i];
}

void ghi()
{
    if (n<1) cout<<0;
    if (n<2)  cout<<1;
    else
    {
long    i=0,Max =2;

        long count = 2;
        long j=2;
        while (j<n)
        {

            if(a[j]==a[j-1]+a[j-2]) count++;
            else
            {
              if (count > Max) Max=count;
               j++;
               count=2;
            }
        }
        i++;
    cout<<Max;
    }
}
main()
{
    nhap();
    ghi();

}


#include <iostream>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    string a , b ;
    int z=0 ;
    cin>>a>>b ;
    for (int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else if (a[i]!=b[i])
        {
            for ( int j=0 ; j<b.size(); j++)
            {
                if (a[i]==b[j])
                    { swap (a[i] , a[j]);
                    z++;
                    }

            }}

    }
    cout<<z<<endl;
    return 0;
}


#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            {c=t-z ;
            cout<<c+z;}
       else if (z>t)
           {c=z-t ;
           cout<<t+c;}
        else if (z=t)
        {c=z;
        cout<<c;}
    return 0 ;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            c=t-z ;
       else if (z>t)
           c=z-t ;
        else
        c=1 ;
        cout<<c ;
    return 0 ;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1=0 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            { c1++ ;
                continue ;}
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            {c=t-z ;
            cout<<c+z;}
       else if (z>t)
           {c=z-t ;
           cout<<t+c;}
        else if (z==t )
        {c=z;
        cout<<c;}
    return 0 ;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            c=t-z ;
       else if (z>t)
           c=z-t ;
        else
        c=t ;
        cout<<c ;
    return 0 ;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a , b ;
    cin>>a;
    cin>>b;
    int z=0 , x=0 , y=0 ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]!=b[i])
        {
            if (a[i]=='4' && b[i]=='7')
            x++ ;
            else if (a[i]=='7' && b[i]=='4')
            y++ ;
        }
    }
    if (x>t)
    {
        z=x-t;
        z+=t ;
        cout<<t <<endl;
    }
    else if (x<t)
    {
        z=t-x ;
        z+=x ;
        cout<<x<<endl;
    }
    else
        cout<<x<<endl;

    /*for ( int i=0 ; i<a.size() ; i++)   // Da Code el ms2la Gab TLE -_-
    {
         bool bb=0;                        // I've Got TLE  in this code
        if (a[i]!=b[i])
        {
        for ( int j=i+1 ; j<a.size() ;j++){
                if (a[i]!=a[j]){
                    if (a[j]==b[j])
                        continue ;
                    else {
                        swap(a[j],a[i]) ;
                        bb=1;
                        z++;
                        break ;
                    }}}
        if (bb==0)
        {a[i]==b[i] ;
        z++ ;}}}*/

        return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 ;
    bool t;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    { t=false ;
        if (a[i]==b[i])
            continue;
        else
        {
            for ( int j=i ; j<a.size() ; j++)
            {
                    if (b[i]==a[j])
                    {
                        swap(a[i],a[j]) ;
                        z++ ;
                        t=true ;
                        i++ ;
                    }
                    else
                        t=false ;
            }
            if (t==false)
                z++ ;
        }
    }
    cout<<z;
}


#include <iostream>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    string a , b ;
    int z=0 ;
    cin>>a>>b ;
    for (int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else if (a[i]!=b[i])
        {
            for ( int j=0 ; j<b.size(); j++)
            {
                if (a[i]==b[j])
                    { swap (a[i] , a[j]);
                    z++;
                    }
                    else
                    {
                        if (a[i]=='7')
                        {replace(a.begin() , a.end() ,'7' ,'4' ) ;
                        z++ ;}
                        else
                           {replace (a.begin() , a.end() , '4' , '7') ;
                           z++ ;}
            }

                    }}}

    cout<<z<<endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            {c=t-z ;
            cout<<c+z;}
       else if (z>t)
           {c=z-t ;
           cout<<t+c;}
        else if (z=t)
        {c=z;
        cout<<c;}
    return 0 ;
}


#include<string>
#include<algorithm>
using namespace std;

int main()
{
    string a , b ;
    int z=0 , t=0 ;
    cin>>a>>b ;
    for (int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else if (a[i]!=b[i])
        {
            for ( int j=0 ; j<b.size(); j++)
            {
                if (a[i]==b[j])
                    { swap (a[i] , a[j]);
                    z++;
                    }
                    else
                    t++ ;
            }

                    }}

t/=a.size();
    cout<<z+t<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a , b ;
    cin>>a;
    cin>>b;
    int z=0 , y ;
    for ( int i=0 ; i<a.size() ; i++)
    {
         bool bb=0;
        if (a[i]!=b[i])
        {
        for ( int j=i+1 ; j<a.size() ;j++){
                if (a[i]!=a[j]){
                    if (a[j]==b[j])
                        continue ;
                    else {
                        swap(a[j],a[i]) ;
                        bb=1;
                        z++;
                        break ;
                    }
                }
            }
        if (bb==0)
        {a[i]==b[i] ;
        z++ ;}
    }}
    cout<<z<<endl;
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a , b ;
    cin>>a;
    cin>>b;
    int z=0 , x=0 , y=0 ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]!=b[i])
        {
            if (a[i]=='4' && b[i]=='7')
            x++ ;
            else if (a[i]=='7' && b[i]=='4')
            y++ ;
        }
    }
    if (x>y)
    {
        z=x-y;
        z+=y ;
        cout<<z<<endl;
    }
    else if (x<y)
    {
        z=y-x ;
        z+=x ;
        cout<<z<<endl;
    }
    else
        cout<<x<<endl;

    /*for ( int i=0 ; i<a.size() ; i++)   // Da Code el ms2la Gab TLE -_-
    {
         bool bb=0;                        // I've Got TLE  in this code
        if (a[i]!=b[i])
        {
        for ( int j=i+1 ; j<a.size() ;j++){
                if (a[i]!=a[j]){
                    if (a[j]==b[j])
                        continue ;
                    else {
                        swap(a[j],a[i]) ;
                        bb=1;
                        z++;
                        break ;
                    }}}
        if (bb==0)
        {a[i]==b[i] ;
        z++ ;}}}*/
        return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            {c=t-z ;
            cout<<c+z;}
       else if (z>t)
           {c=z-t ;
           cout<<t+z;}
        else if (z=t)
        {c=z;
        cout<<c;}
    return 0 ;
}


#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string a , b ;
    int z=0 , t=0 , x=0,c=0 ,c1 ;
    cin>>a>>b ;
    for ( int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else
        {
            if(a[i]=='7'&&b[i]=='4')
                t++ ;
            if (a[i]=='4'&&b[i]=='7')
                z++ ;
        }
        }
        if (t>z)
            c=t-z ;
       else if (z>t)
           c=z-t ;
        else
        c=z ;
        cout<<c ;
    return 0 ;
}


#include <iostream>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    string a , b ;
    int z=0 , t=0 ;
    cin>>a>>b ;
    for (int i=0 ; i<a.size() ; i++)
    {
        if (a[i]==b[i])
            continue ;
        else if (a[i]!=b[i])
        {
            for ( int j=0 ; j<b.size(); j++)
            {
                if (a[i]==b[j])
                    { swap (a[i] , a[j]);
                    z++;
                    }
                    else
                    t++ ;
            }

                    }}

t/=a.size();
    cout<<z+t<<endl;
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{
    char a[100005];
    char b[100005];
    int res,Num1=0,Num2=0,len;

    gets(a);
    gets(b);
    len = strlen(a);

    for (int i = 0; i<1000;i++)
    {
        if(a[i]=='4'&& b[i]=='7'){Num1++;}
        if(a[i]=='7'&& b[i]=='4'){Num2++;}
    }
    res = max(Num1,Num2);
    printf("%d",res);
}


#include <iostream>
#include <cstring>
#include <stdio.h>
#define LEN 100000+5
using namespace std;

int main()
{
    char a[LEN];
    char b[LEN];
    int res,Num1=0,Num2=0,len;

    gets(a);
    gets(b);
    len = strlen(a);

    for (int i = 0; i<1000;i++)
    {
        if(a[i]=='4'&& b[i]=='7'){Num1++;}
        if(a[i]=='7'&& b[i]=='4'){Num2++;}
    }
    res = max(Num1,Num2);
    printf("%d",res);
}


#include <iostream>
#include <cstring>
#include <stdio.h>
using namespace std;

int main()
{
    char a[100000];
    char b[100000];
    int res,Num1=0,Num2=0,len;

    gets(a);
    gets(b);
    len = strlen(a);

    for (int i = 0; i<100000;i++)
    {
        if(a[i]=='4'&& b[i]=='7'){Num1++;}
        if(a[i]=='7'&& b[i]=='4'){Num2++;}
    }
    res = max(Num1,Num2);
    printf("%d",res);
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{
    char a[10000];
    char b[10000];
    int res,Num1=0,Num2=0,len;

    gets(a);
    gets(b);
    len = strlen(a);

    for (int i = 0; i<1000;i++)
    {
        if(a[i]=='4'&& b[i]=='7'){Num1++;}
        if(a[i]=='7'&& b[i]=='4'){Num2++;}
    }
    res = max(Num1,Num2);
    printf("%d",res);
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{
    char a[1000];
    char b[1000];
    int res =0,Num1=0,Num2=0,len = 0;

    gets(a);
    gets(b);
    len = strlen(a);

    for (int i = 0; i<1000;i++)
    {
        if(a[i]=='4'&& b[i]=='7'){Num1++;}
        if(a[i]=='7'&& b[i]=='4'){Num2++;}
    }
    res = max(Num1,Num2);
    cout<<res;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{
    string a,b;cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{
        long long i=0;
        for(long long  r=0;r<b.size();r++){if(b[r]==a[r]){continue;}else{i++;}}
        long long result=0,z=0;
        for(long long i=0;i<b.size();i++){
                if(b[i]==a[i]){continue;}
                else{
                    for(long long y=i+1;y<b.size();y++){
                        if(a[y]!=b[y] && a[i] !=a[y]){
                                z=y;
                            break;
                        }

                    }
                    swap(a[z],a[i]);result++;
                    if(a==b){break;}
                }
        }

          cout<<min(result,i);

    }

 return 0;
}


/*#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
vector<string>of;
vector<string>off;
string major="major",mainor="minor",strang="strange";

int main()
{
    string f="D#";
    //cin>>f;
    int vx=0,vy=0;
    off.push_back(f);
    string h="B";
    //cin>>h;
    off.push_back(h);
    string s="G";
    //cin>>s;
    off.push_back(s);
    sort(off.begin(),off.end());
    string x=off[0],y=off[1],z=off[2];
    of.push_back("C");of.push_back("C#");of.push_back("D");of.push_back("D#");
    of.push_back("E");of.push_back("F");of.push_back("F#");of.push_back("G");
    of.push_back("G#");of.push_back("A");of.push_back("B");of.push_back("H");
    int qx=0,qy=0,qz=0;
    for(int i=0;i<of.size();i++){if(of[i]==x){qx=i;}if(of[i]==y){qy=i;}if(of[i]==z){qz=i;}}
    bool fag1=1,fag2=1,fag3=1;
    cout<<x<<" "<<y<<" "<<z<<endl;
   for(int i=qx;i<of.size();i++){
        if(of[i]!=y){vx++;}
        else{fag1=0;break;}
    }
    if(fag1){

        for(int i=0;i<of.size();i++){
                if(of[i]!=y){vx++;}
                else{break;}

        }
    }
    for(int i=qy;i<of.size();i++){
        if(of[i]!=z){vy++;}
        else{fag2=0;break;}
    }
    if(fag2){

        for(int i=0;i<of.size();i++){
                if(of[i]!=z){vy++;}
                else{break;}

        }
    }
    int vz=0;
    for(int i=qx;i<of.size();i++){
        if(of[i]!=z){vz++;}
        else{fag3=0;break;}
    }
    if(fag3){

        for(int i=0;i<of.size();i++){
                if(of[i]!=z){vz++;}
                else{break;}

        }
    }
    if(vx==4 &&vy==3&&vz==7){cout<<major<<endl;
    }else if(vx==3 &&vy==4 &&vz==7){cout<<mainor<<endl;}
    else{cout<<strang<<endl;}
    return 0;
}
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;

vector<int>lolo;
int main()
{
    string a,b;cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{
        string h=a,q=b;
        h.erase( unique( h.begin(), h.end() ), h.end());
        q.erase( unique( q.begin(), q.end() ), q.end());
        int i=0;
        for(int r=0;r<b.size();r++){if(b[r]==a[r]){continue;}else{i++;}}
        if(h.size()==1&&q.size()==1){cout<<i<<endl;return 0;}
        lolo.push_back(i);
        int result=0,z=0;
        bool of=0;
        for(int i=0;i<b.size();i++){
                if(b[i]==a[i]){continue;}
                else{
                    for(int y=i+1;y<b.size();y++){
                        if(a[y]!=b[y] && a[i] !=a[y]){
                                z=y;
                            break;
                        }

                    }
                    swap(a[z],a[i]);result++;
                    if(a==b){of=1;break;}
                }
        }

          cout<<min(result,i);

    }

 return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{

    long long i=0;
   string a,b;
    cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{
         long long q=0;
        for(long long i=0;i<b.size();i++){if(a[i]!=b[i]){q++;}}
        long long i7=0,i4=0;
        for(long long w=0;w<b.size();w++){
            if(b[w]!=a[w]){
                if(a[w]=='7'){i7++;}
                else{i4++;}
            }
        }
            long long z=max(i4,i7);
          cout<<min(z,q);

    }

 return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{
    long long i=0;
    long long result=0,z=0;
    string a,b;cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{

        long long q=0;
        long long result=0,z=0;
        for(long long i=0;i<b.size();i++){
                if(b[i]==a[i]){continue;}
                else{
                    q++;
                    for(long long y=i+1;y<b.size();y++){
                        if(a[y]!=b[y] && a[i] !=a[y]){
                                z=y;
                            break;
                        }

                    }
                    swap(a[z],a[i]);result++;
                    if(a==b){break;}
                }
        }

          cout<<min(result,q);

    }

 return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{
    string a,b;cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{
        long long i=0;
        long long result=0,z=0;
        for(long long i=0;i<b.size();i++){
                if(b[i]==a[i]){continue;}
                else{
                        i++;
                    for(long long y=i+1;y<b.size();y++){
                        if(a[y]!=b[y]&&a[i]!=a[y]){
                                z=y;
                            break;
                        }

                    }
                    swap(a[z],a[i]);result++;
                    if(a==b){break;}
                }
        }

          cout<<min(result,i);

    }

 return 0;
}


/*#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
vector<string>of;
vector<string>off;
string major="major",mainor="minor",strang="strange";

int main()
{
    string f="D#";
    //cin>>f;
    int vx=0,vy=0;
    off.push_back(f);
    string h="B";
    //cin>>h;
    off.push_back(h);
    string s="G";
    //cin>>s;
    off.push_back(s);
    sort(off.begin(),off.end());
    string x=off[0],y=off[1],z=off[2];
    of.push_back("C");of.push_back("C#");of.push_back("D");of.push_back("D#");
    of.push_back("E");of.push_back("F");of.push_back("F#");of.push_back("G");
    of.push_back("G#");of.push_back("A");of.push_back("B");of.push_back("H");
    int qx=0,qy=0,qz=0;
    for(int i=0;i<of.size();i++){if(of[i]==x){qx=i;}if(of[i]==y){qy=i;}if(of[i]==z){qz=i;}}
    bool fag1=1,fag2=1,fag3=1;
    cout<<x<<" "<<y<<" "<<z<<endl;
   for(int i=qx;i<of.size();i++){
        if(of[i]!=y){vx++;}
        else{fag1=0;break;}
    }
    if(fag1){

        for(int i=0;i<of.size();i++){
                if(of[i]!=y){vx++;}
                else{break;}

        }
    }
    for(int i=qy;i<of.size();i++){
        if(of[i]!=z){vy++;}
        else{fag2=0;break;}
    }
    if(fag2){

        for(int i=0;i<of.size();i++){
                if(of[i]!=z){vy++;}
                else{break;}

        }
    }
    int vz=0;
    for(int i=qx;i<of.size();i++){
        if(of[i]!=z){vz++;}
        else{fag3=0;break;}
    }
    if(fag3){

        for(int i=0;i<of.size();i++){
                if(of[i]!=z){vz++;}
                else{break;}

        }
    }
    if(vx==4 &&vy==3&&vz==7){cout<<major<<endl;
    }else if(vx==3 &&vy==4 &&vz==7){cout<<mainor<<endl;}
    else{cout<<strang<<endl;}
    return 0;
}
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include<cmath>
#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <vector>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{
    string a,b;cin>>a;cin>>b;
    if(a==b){
        cout<<0<<endl;return 0;
    }else{
        int i=0;
        for(int r=0;r<b.size();r++){if(b[r]==a[r]){continue;}else{i++;}}
        int result=0,z=0;
        bool of=0;
        for(int i=0;i<b.size();i++){
                if(b[i]==a[i]){continue;}
                else{
                    for(int y=i+1;y<b.size();y++){
                        if(a[y]!=b[y] && a[i] !=a[y]){
                                z=y;
                            break;
                        }

                    }
                    swap(a[z],a[i]);result++;
                    if(a==b){of=1;break;}
                }
        }

          cout<<min(result,i);

    }

 return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c=1,c1=0 ,f1=0,f=0;
     for(unsigned i=0 ,j=s.length()-1;i<s.length();i++,j--)
     {
         if(s[i]!=s1[i])
         {

              c1++;
         }
         if(s[i]=='4')
            f++;
        if(s1[i]=='4')
            f1++;

     }
     if(f==0||f1==0)

     cout<< c1<<endl;
     else
     cout<<abs(f-f1)+c1/2<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c=1,c1=0 ,f1=0,f=0;
     for(unsigned i=0 ,j=s.length()-1;i<s.length();i++,j--)
     {
         if(s[i]!=s1[i])
         {

              c1++;
         }
         if(s[i]=='4')
            f++;
        if(s1[i]=='4')
            f1++;

     }
     if(f==0||f1==0)

     cout<< c1<<endl;
     else
     cout<<abs(f-f1)+(c1-abs(f-f1))/2<<endl;
    // cout<<abs(f-f1)<<endl;
    // cout<<c1/2<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c1=0 ,f1=0,f=0;
     for(unsigned i=0;i<s.length();i++)
     {
         if(s[i]!=s1[i])
              c1++;
         if(s[i]=='4')
            f++;
        if(s1[i]=='4')
            f1++;
     }
     if(f==0||f1==0)
     cout<<c1<<endl;
     else
     cout<<abs(f-f1)+(c1-abs(f-f1))/2<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c=1,c1=0 ;
     for(unsigned i=0 ,j=s.length()-1;i<s.length();i++,j--)
     {
         if(s[i]!=s1[j])
         {
            // s[i]=s1[i];
             c++;
         }
         if(s[i]!=s1[i])
         {
             //s[i]=s1[i];
              c1++;
         }
     }
     if(c==0)
    cout<<1<<endl;
    if(c<=c1&&c!=0)
        cout<<c<<endl;
        else
             cout<<c1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c=1,c1=0 ,f1=0,f=0;
     for(unsigned i=0 ,j=s.length()-1;i<s.length();i++,j--)
     {
         if(s[i]!=s1[i])
         {

              c1++;
         }
         if(s[i]=='4')
            f++;
        if(s1[i]=='4')
            f1++;

     }
     if(f==0||f1==0)
     cout<< c1<<endl;
     else
     cout<<abs(f-f1)+(c1-abs(f-f1))/2<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1 ;
    cin>>s>>s1;
    int c1=0 ,f1=0,f=0;
     for(unsigned i=0 ,j=s.length()-1;i<s.length();i++,j--)
     {
         if(s[i]!=s1[i])
         {

              c1++;
         }
         if(s[i]=='4')
            f++;
        if(s1[i]=='4')
            f1++;

     }
     if(f==0||f1==0)
     cout<< c1<<endl;
     else
     cout<<abs(f-f1)+(c1-abs(f-f1))/2<<endl;
    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main ()
{
	string a,b;
	cin>>a>>b;
	int l=a.length(),c=0;
	bool k=false;
	for(int i=0;i<l;i++)
	{
		if (a[0]!=a[i]||b[0]!=b[i])
		{
			k=true;break;
		}
	}
	for (int i=0;i<l;i++)
	{
		if(a[i]!=b[i])
		{
			c++;
		}
	}
	if (k)
	{
	cout<<(c/2)+(c%2)<<endl;
	}
	else
	{
		cout<<c<<endl;
	}
    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main ()
{
	string a,b;
	cin>>a>>b;
	int l=a.length();
	for (int i=0;i<l;i++)
	{
		if(a[i]==b[i])
		{
			a.erase(i,1);
			l--;
		}
	}
	for (int i=0;i<l;i++)
	{
		for (int j=i+1;j<l;j++)
		{
			if(a[i]!=a[j])
			{
				a.erase(j,1);
				l--;
			}
		}
	}
	cout<<l<<endl;

    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main ()
{
	string a,b;
	cin>>a>>b;
	int l=a.length();
	for (int i=0;i<l;i++)
	{
		if(a[i]==b[i])
		{
			a.erase(i,1);
			b.erase(i,1);
			l--;
			i--;

		}
	}
	for (int i=0;i<l;i++)
	{
		for (int j=i+1;j<l;j++)
		{
			if(a[i]!=a[j])
			{
				a.erase(j,1);
				l--;
				j--;
				break;
			}
		}
	}
	cout<<l<<endl;

    return 0;
}


#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
using namespace std;
int main ()
{
	string a,b;
	cin>>a>>b;
	int l=a.length(),c=0;
	for (int i=0;i<l;i++)
	{
		if(a[i]!=b[i])
		{
			c++;
		}
	}
	if(c!=l)
	{cout<<(c/2)+(c%2)<<endl;}
	else
	{cout<<c<<endl;}

    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main ()
{
	string a,b;
	cin>>a>>b;
	int l=a.length();
	for (int i=0;i<l;i++)
	{
		if(a[i]==b[i])
		{
			a.erase(i,1);
			b.erase(i,1);
			l--;
			i--;

		}
	}
	int c=0,s=0;
	for (int i=0;i<l;i++)
	{
		if(a[i]=='4')
		{
			c++;
		}
	}
	for (int i=0;i<l;i++)
	{
		if(a[i]=='7')
		{
			s++;
		}
	}
	if(c>=s)
	{
	cout<<l-s<<endl;
	}
	else
	{
	cout<<l-c<<endl;
	}

    return 0;
}


#include <iostream>

using namespace std;

int main()
{int n,s;
cin>>n;
if(n==0) s=2;
else {if(n%4==0) s=7;
else if(n%4==1) s=5;
else if(n%4==2) s=3;
else s=5;

}
cout<<s;
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

	string a, b;
	int ans = 0, a7, b7, sz, tmp;
	cin >> a >> b;

	sz = a.size();
	a7 = count(a.begin(),a.end(),'7');
	b7 = count(b.begin(),b.end(),'7');
	ans += (abs(a7-b7));

	tmp = ans;
	for(int i=0; i<sz && tmp; i++){
		if(a7>b7 && a[i]!=b[i] && a[i] == '7'){
			a[i] = '4';
			tmp--;
		}
		else if(b7>a7 && a[i]!=b[i] && a[i] == '4'){
			a[i] = '7';
			tmp--;
		}
	}

	for(int i=0; i<sz; i++) tmp += (a[i]!=b[i]);

	cout << ans + (tmp/2);

	return 0;
}


#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {

    string a, b;
    int ans = 0, a7, b7, sz, tmp;
    cin >> a >> b;

    sz = a.size();
    for(int i=0; i<sz; i++){
        if(a[i]=='7') a7++;
        if(b[i]=='7') b7++;
    }
    ans += (abs(a7-b7));

    tmp = ans;
    for(int i=0; i<sz && tmp; i++){
        if(a7>b7 && a[i]!=b[i] && a[i] == '7'){
            a[i] = '4';
            tmp--;
        }
        else if(b7>a7 && a[i]!=b[i] && a[i] == '4'){
            a[i] = '7';
            tmp--;
        }
    }

    for(int i=0; i<sz; i++) tmp += (a[i]!=b[i]);

    cout << ans + (tmp/2);

    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

    string a, b;
    int a7, b7, sz, ans = 0;
    cin >> a >> b;

    sz = a.size();
    a7 = count(a.begin(), a.end(), '7');
    b7 = count(b.begin(), b.end(), '7');

    if (a7-b7 > 0){
        for(int i=0; i<sz; i++)
            if(a[i]!=b[i] && a[i]=='7'){
                ans ++;
                a[i] = '4';
            }
    }
    else if(b7-a7 > 0){
        for(int i=0; i<sz; i++)
            if(a[i]!=b[i] && a[i]=='4'){
                ans ++;
                a[i] = '7';
            }
    }

    if(a!=b)
        for(int i=0; i<sz; i++)
            if(a[i]!=b[i])
                for(int j=i+1; j<sz; j++)
                    if(a[i]!=a[j] && b[i]!=b[j]){
                        ans ++;
                        swap(a[i],a[j]);
                        break;
                    }

    cout << ans;

    return 0;
}


#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {

    string a, b;
    int ans = 0, a7 = 0, b7 = 0, sz, tmp;
    cin >> a >> b;

    sz = a.size();
    for(int i=0; i<sz; i++){
        if(a[i]=='7') a7++;
        if(b[i]=='7') b7++;
    }
    ans += (abs(a7-b7));

    tmp = ans;
    for(int i=0; i<sz && tmp; i++){
        if(a7>b7 && a[i]!=b[i] && a[i] == '7'){
            a[i] = '4';
            tmp--;
        }
        else if(b7>a7 && a[i]!=b[i] && a[i] == '4'){
            a[i] = '7';
            tmp--;
        }
    }

    for(int i=0; i<sz; i++) tmp += (a[i]!=b[i]);

    cout << ans + (tmp/2);

    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

    string a, b;
    int ans = 0, a7, b7, sz, tmp;
    cin >> a >> b;

    sz = a.size();
    a7 = count(a.begin(),a.end(),'7');
    b7 = count(b.begin(),b.end(),'7');
    ans += (abs(a7-b7));

    if(a7>b7){
        tmp = ans;
        for(int i=0; i<sz && tmp; i++){
            if(a[i]!=b[i] && a[i] == '7'){
                a[i] = '4';
                tmp--;
            }
        }
    }
    else if(b7>a7){
        tmp = ans;
        for(int i=0; i<sz && tmp; i++){
            if(a[i]!=b[i] && a[i] == '4'){
                a[i] = '7';
                tmp--;
            }
        }
    }

    tmp = 0;
    for(int i=0; i<sz; i++) tmp += (a[i]!=b[i]);

    cout << ans + (tmp/2);

    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

    string a, b;
    int a7, b7, sz, ans = 0, tmp = 0;
    cin >> a >> b;

    sz = a.size();
    a7 = count(a.begin(), a.end(), '7');
    b7 = count(b.begin(), b.end(), '7');

    if (a7-b7 > 0){
        for(int i=0; i<sz; i++)
            if(a[i]!=b[i] && a[i]=='7'){
                ans ++;
                a[i] = '4';
            }
    }
    else if(b7-a7 > 0){
        for(int i=0; i<sz; i++)
            if(a[i]!=b[i] && a[i]=='4'){
                ans ++;
                a[i] = '7';
            }
    }

    for(int i=0; i<sz; i++) if(a[i]!=b[i]) tmp ++;

    cout << ans+(tmp/2);

    return 0;
}


#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {

	string a, b;
	int ans = 0, a7, b7, sz, tmp;
	cin >> a >> b;

	sz = a.size();
	for(int i=0; i<sz; i++){
		if(a[i]=='7') a7++;
		if(b[i]=='7') b7++;
	}
	ans += (abs(a7-b7));

	tmp = ans;
	for(int i=0; i<sz && tmp; i++){
		if(a7>b7 && a[i]!=b[i] && a[i] == '7'){
			a[i] = '4';
			tmp--;
		}
		else if(b7>a7 && a[i]!=b[i] && a[i] == '4'){
			a[i] = '7';
			tmp--;
		}
	}

	for(int i=0; i<sz; i++) tmp += (a[i]!=b[i]);

	cout << ans + (tmp/2);

	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    string a,b;
    cin>>a>>b;
    long int c7=0,c4=0,ans=0;
    for(int i=0;i<(a.size());i++)
    {
        if(a[i]!=b[i])
        {
            if(a[i]=='4')c4++;
            else c7++;
        }
    }
    if(c7>c4)ans=c7;
    else if(c4>=c7)ans=c4;
    cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    string a,b;
    cin>>a>>b;
    int mini=0;
    bool check=false;
    //sort(a.begin(),a.end());
    //sort(b.begin(),b.end());
    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if(a[k]!=a[i]&&a[k]!=b[k])
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }

            }
            if(check==false&&a[i]==4)a[i]=7;
            else if(check==false&&a[i]==7)a[i]=4;

            mini++;
        }
    }
    cout<<mini<<endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    string a="",b="";
    cin>>a>>b;
    int mini=0;
    bool check=false;
    string a1=a,b1=b;
    sort(a1.begin(),a1.end());
    sort(b1.begin(),b1.end());
    if(a1==b1)
    {
        for(int i=0;i<a.size();++i)
        {
            if(a[i]!=b[i])mini++;
        }
        if(a.size()==2)mini--;
        cout<<mini<<endl;

    }
    else
    {
    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if(a[k]!=a[i]&&a[k]!=b[k])
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }
                if(k==(a.size()-1))break;
            }
            if(check==false&&a[i]==4)a[i]=7;
            else if(check==false&&a[i]==7)a[i]=4;

            mini++;
        }
        check=false;
    }
    cout<<mini<<endl;
    }

    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    string a="",b="";
    cin>>a>>b;
    int mini=0;
    bool check=false;
    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if(a[k]!=a[i]&&a[k]!=b[k])
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }
                if(k==(a.size()-1))break;
            }
            if(check==false&&a[i]==4)a[i]=7;
            else if(check==false&&a[i]==7)a[i]=4;

            mini++;
        }
        check=false;
    }
    cout<<mini<<endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    string a="",b="";
    cin>>a>>b;
    int mini=0;
    bool check=false;
    string a1=a,b1=b;
    sort(a1.begin(),a1.end());
    sort(b1.begin(),b1.end());
    if(a1==b1)
    {
        for(int i=0;i<a.size();++i)
        {
            if(a[i]!=b[i])mini++;
        }
        cout<<mini<<endl;

    }
    else
    {
    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if(a[k]!=a[i]&&a[k]!=b[k])
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }
                if(k==(a.size()-1))break;
            }
            if(check==false&&a[i]==4)a[i]=7;
            else if(check==false&&a[i]==7)a[i]=4;

            mini++;
        }
        check=false;
    }
    cout<<mini<<endl;
    }

    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string a="",b="";
    cin>>a>>b;
    int mini=0;
    bool check=false;

    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if(a[k]!=a[i]&&a[k]!=b[k])
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }
                if(k==(a.size()-1))break;
            }
            if(check==false&&a[i]==4)a[i]=7;
            else if(check==false&&a[i]==7)a[i]=4;

            mini++;
        }
        else continue;
        check=false;
    }
    cout<<mini<<endl;

    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string a="",b="";
    cin>>a>>b;
    int mini=0;
    bool check=false;
    for(int i=0;i<a.size();++i)
    {
        if(a[i]!=b[i])
        {
            int k=i;
            while(1)
            {
                k++;
                if((a[k]!=a[i])&&(a[k]!=b[k]))
                {
                    swap(a[i],a[k]);
                    check=true;
                    break;
                }
                if(k==(a.size()-1))break;
            }
            if(check==false&&a[i]=='4')a[i]=7+48;
            else if(check==false&&a[i]=='7')a[i]=4+48;
            mini++;
        }
        check=false;
    }
    cout<<mini<<endl;

    return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;
	int a[100000],b[100000],num;
	for(int i=0;str1[i]!='\0';i++)
		a[i]=b[i]=-1;
	bool check[100000]={false};
	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{	if(str1[i]==str2[i])
			check[i]=true;
		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4'&&b[k]>-1)
			{
				count++;
				check[i]=check[b[k]]=true;
				k++;
			}
			else
			{
				a[x]=i;
				x++;
			}
			if(str1[i]=='7'&&a[j]>-1)
			{
				count++;
				check[i]=check[a[j]]=true;
				j++;
			}
			else
			{
				b[y]=i;
				y++;
			}
		}
	}
	for(long int i=0;str1[i]!='\0';i++)
	{
		if(!check[i])
			count++;
	}
	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;
	int a[100000],b[100000],num;
	for(int i=0;str1[i]!='\0';i++)
		a[i]=b[i]=-1;

	bool check[100000]={false};
	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{	if(str1[i]==str2[i])
			check[i]=true;
		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4'&&b[k]>-1)
			{
				count++;
				check[i]=check[b[k]]=true;
				k++;
			}
			else if(b[k]==-1)
			{
				a[x]=i;
				x++;
			}
			else if(str1[i]=='7'&&a[j]>-1)
			{	cout<<"s";
				count++;
				check[i]=check[a[j]]=true;
				j++;
			}
			else
			{
				b[y]=i;
				y++;
			}
		}
	}
	for(long int i=0;str1[i]!='\0';i++)
	{
		if(!check[i])
			count++;
	}
	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;

	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{

		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4')
				j++;
			else
				k++;
		}

	}
	if(j>k)
		count=j;
	else
		count=k;

	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[1000000],str2[1000000];
	cin>>str1>>str2;

	long long int count=0;

	long long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{

		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4')
				j++;
			else
				k++;
		}

	}
	if(j>k)
		count=j;
	else
		count=k;

	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;
	int a[100000],b[100000],num;
	for(int i=0;str1[i]!='\0';i++)
		a[i]=b[i]=-1;

	bool check[100000]={false};
	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{	if(str1[i]==str2[i])
			check[i]=true;
		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4'&&b[k]>-1)
			{
				count++;
				check[i]=check[b[k]]=true;
				k++;
			}
			else if(b[k]==-1&&str1[i]=='4')
			{
				a[x]=i;
				x++;
			}
			else if(str1[i]=='7'&&a[j]>-1)
			{
				count++;
				check[i]=check[a[j]]=true;
				j++;
			}
			else
			{
				b[y]=i;
				y++;
			}
		}
	}
	count+=x-j+y-k;
	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;
	int a[100000],b[100000],num;
	for(int i=0;str1[i]!='\0';i++)
		a[i]=b[i]=-1;

	bool check[100000]={false};
	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{	if(str1[i]==str2[i])
			check[i]=true;
		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4'&&b[k]>-1)
			{
				count++;
				check[i]=check[b[k]]=true;
				k++;
			}
			else if(b[k]==-1&&str1[i]=='4')
			{
				a[x]=i;
				x++;
			}
			else if(str1[i]=='7'&&a[j]>-1)
			{
				count++;
				check[i]=check[a[j]]=true;
				j++;
			}
			else
			{
				b[y]=i;
				y++;
			}
		}
	}
	for(long int i=0;str1[i]!='\0';i++)
	{
		if(!check[i])
			count++;
	}
	cout<<count;
	return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
	char str1[100000],str2[100000];
	cin>>str1>>str2;

	long int count=0;
	long int a[100000],b[100000];

	bool check[100000]={false};
	long int j=0,k=0,x=0,y=0;
	for(long int i=0;str1[i]!='\0';i++)
	{	a[i]=b[i]=-1;
		if(str1[i]==str2[i])
			check[i]=true;
		if(str1[i]!=str2[i])
		{
			if(str1[i]=='4'&&b[k]>-1)
			{
				count++;
				check[i]=check[b[k]]=true;
				k++;
			}
			else if(b[k]==-1&&str1[i]=='4')
			{
				a[x]=i;
				x++;
			}
			else if(str1[i]=='7'&&a[j]>-1)
			{
				count++;
				check[i]=check[a[j]]=true;
				j++;
			}
			else
			{
				b[y]=i;
				y++;
			}
		}
	}
	count+=x-j+y-k;
	cout<<count;
	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s1,s2,s3;
    int c=0,t=0;
    cin>>s1>>s2;
    s3=s1;
    for(int i=0;i<s1.size();i++)
    {
        if(s2==s3)
        {
            break;
        }
        else if(s2[i]!=s1[i])
        {
            for(int j=i+1;j<s1.size();j++)
            {
                if((s2[j]==s1[i]))
                {
                    swap(s2[j],s2[i]);
                    c++;
                    t=1;
                    break;
                }
            }

            if(t==1)
            t=0;
            else
            {
                s2[i]=s1[i];
                c++;
            }
        }
        else if(s2[i]==s1[i])
        continue;
    }
    cout<<c;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s1,s2,s3;
    int c=0,t=0;
    cin>>s1>>s2;
    s3=s1;
    for(int i=0;i<s1.size();i++)
    {
        if(s2==s3)
        {
            break;
        }
        else if(s2[i]!=s1[i])
        {
            for(int j=i+1;j<s1.size();j++)
            {
                if(s2[j]==s1[i]&&s1[j]!=s2[j])
                {
                    swap(s2[j],s2[i]);
                    c++;
                    t=1;
                    break;
                }
            }

            if(t==1)
            t=0;
            else
            {
                s2[i]=s1[i];
                c++;
            }
        }
    }
    cout<<c;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s1,s2,s3;
    int c=0,t=0;
    cin>>s1>>s2;
    s3=s1;
    for(int i=0;i<s1.size();i++)
    {
        if(s2==s3)
        {
            break;
        }
        else if(s2[i]!=s1[i])
        {
            for(int j=i+1;j<s1.size();j++)
            {
                if((s2[j]==s1[i])&&(s1[j]==s2[i]))
                {
                    swap(s2[j],s2[i]);
                  //  cout<<">>S"<<i<<"  "<<j<<endl;
                    c++;
                    t=1;
                    break;
                }
            }

            if(t==1)
            t=0;
            else
            {
                s2[i]=s1[i];
            //    cout<<">>O"<<i<<endl;
                c++;
            }
        }
        else if(s2[i]==s1[i])
        continue;
    }
    cout<<c;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s,s1;
    cin>>s>>s1;
    int t1=0,t2=0;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='4'&&s1[i]=='7')
        t1++;
        else if(s[i]=='7'&&s1[i]=='4')
        t2++;
    }
    if(t1>=t2)
    cout<<t1;
    else cout<<t2;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    string s1,s2,s3;
    int c=0,t=0;
    cin>>s1>>s2;
    s3=s1;
    for(int i=0;i<s1.size();i++)
    {
        if(s2==s3)
        {
            break;
        }
        else if(s2[i]!=s1[i])
        {
            for(int j=i+1;j<s1.size();j++)
            {
                if(s2[j]==s1[i])
                {
                    swap(s2[j],s2[i]);
                    c++;
                    t=1;
                    break;
                }
            }

            if(t==1)
            t=0;
            else
            {
                s2[i]=s1[i];
                c++;
            }
        }
    }
    cout<<c;
    return 0;
}