#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define ld long double
#define pb push_back
#define mkp make_pair
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define fi first
#define sc second
#define deb 0

int mp[1000001];
char s[2];

int main()
{
	ll n, m, i, j, k, x, y, z, a, b, c;

	scl(n);
	while (n--) {
		scanf("%s %lld", s, &x);
		if (s[0] == '+') {
			a = 0;
			if (!(x&1)) mp[0]++;
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) a |= (1<<i);
				if (b) mp[a]++;
				if (!x) break;
			}
		} else if (s[0] == '-') {
			a = 0;
			if (!(x&1)) mp[0]--;
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) a |= (1<<i);
				if (b) mp[a]--;
				if (!x) break;
			}
		} else {
			a = 0;
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) a |= (1<<i);
				if (!x) break;
			}
			printf("%d\n", mp[a]);
		}
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define ld long double
#define pb push_back
#define mkp make_pair
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define fi first
#define sc second
#define deb 0

map <string, int> mp;
char s[2];

int main()
{
	ll n, m, i, j, k, x, y, z, a, b, c;
	string st;
	scl(n);
	while (n--) {
		scanf("%s %lld", s, &x);
		if (s[0] == '+') {
			st = "";
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) st = "1" + st;
				else st = "0" + st;
				mp[st]++;
			}
		} else if (s[0] == '-') {
			st = "";
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) st = "1" + st;
				else st = "0" + st;
				mp[st]--;
			}
		} else {
			st = "";
			for (i = 0; i < 18; ++i) {
				b = x&1;
				x /= 10;
				if (b) st = "1" + st;
				else st = "0" + st;
			}
			cout << mp[st] << endl;
		}
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define ld long double
#define pb push_back
#define mkp make_pair
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define fi first
#define sc second
#define deb 0

char s[2];
int mp[1000001];

int bin(int x)
{
	int a = 0;
	for (int i = 0; i < 20; ++i) {
		if (x&1) a |= (1<<i);
		x /= 10;
	}
	return a;
}

int main()
{
	ll n, m, i, j, k, x, y, z, a, b, c;
	string st;
	scl(n);
	while (n--) {
		scanf("%s %lld", s, &x);
		if (s[0] == '+') {
			mp[bin(x)]++;
		} else if (s[0] == '-') {
			mp[bin(x)]--;
		} else {
			cout << mp[bin(x)] << endl;
		}
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define ld long double
#define pb push_back
#define mkp make_pair
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define fi first
#define sc second
#define deb 0

char s[2];
int mp[1000001];

int bin(ll x)
{
	int a = 0;
	for (int i = 0; i < 20; ++i) {
		if (x&1) a |= (1<<i);
		x /= 10;
	}
	return a;
}

int main()
{
	ll n, m, i, j, k, x, y, z, a, b, c;
	string st;
	scl(n);
	while (n--) {
		scanf("%s %lld", s, &x);
		if (s[0] == '+') {
			mp[bin(x)]++;
		} else if (s[0] == '-') {
			mp[bin(x)]--;
		} else {
			cout << mp[bin(x)] << endl;
		}
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector<long long> m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        long long a;
        if (s=='-'||s=='+')
        {
            cin>>a;
            if (s=='+')
                {
                    if (m.empty())
                        m.push_back(a);
                    else
                    {
                        m.insert(lower_bound(m.begin(),m.end(),a),a);
                    }
                }
            else
                m.erase(lower_bound(m.begin(),m.end(),a));
        }
        else if (s=='?')
        {
            string c;
            cin>>c;
            a=0;
            int ff=0,q=0;
            int j=c.size();
            j--;
            pair<long long ,int>p;
            p.first=-1,p.second=0;
            for (auto i:m)
            {
                if (i!=p.first)
                {
                    p.second=0;
                    q=0;
                    a=i;
                    string b;
                    while (a)
                    {
                        int e=a%10;
                        if (e%2==0)
                            b.push_back('0');
                        else
                            b.push_back('1');
                        a/=10;
                    }
                    string f;
                    reverse(b.begin(),b.end());
                    int r=b.size(),u=c.size();
                    int w=abs(r-u);
                    for (int i=0; i<w; i++)
                        f.push_back('0');
                    if (w==0)
                    {
                        if (b!=c)
                            q=1;
                    }
                    else
                    {
                        if (u<r)
                        {
                            f+=c;
                            //cout<<i<<" "<<f<<" "<<b<<endl;
                            if (f!=b)
                                q=1;
                        }
                        else
                        {
                            f+=b;
                            //cout<<i<<" "<<f<<" "<<c<<endl;
                            if (f!=c)
                                q=1;
                        }
                    }
                    if (q==0)
                    {
                        ff++;
                        p.second=1;
                    }
                    p.first=i;
                }
                else
                    ff+=p.second;
            }
            cout<<ff<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
map<string,int>m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        if (s=='?')
        {
            string a;
            cin>>a;
            int b=a.size();
            string f;
            for (int i=0;i<18-b;i++)
                f.push_back('0');
            f+=a;
            cout<<m[f]<<endl;
        }
        else
        {
            long long a;
            cin>>a;
            string b;
            while (a)
            {
                if ((a%10)%2==0)
                    b.push_back('0');
                else
                    b.push_back('1');
                a/=10;

            }
            reverse(b.begin(),b.end());
            int c=b.size();
            string f;
            for (int i=0;i<18-c;i++)
                f.push_back('0');
            f+=b;
            if (s=='+')
                m[f]++;
            else
                m[f]--;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector<long long> m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        long long a;
        if (s=='-'||s=='+')
        {
            cin>>a;
            if (s=='+')
                {
                    if (m.empty())
                        m.push_back(a);
                    else
                    {
                        if (lower_bound(m.begin(),m.end(),a)-m.begin()!=0)
                        m.insert(lower_bound(m.begin(),m.end(),a)-1,a);
                        else
                            m.insert(lower_bound(m.begin(),m.end(),a),a);
                    }

                }
            else
                m.erase(lower_bound(m.begin(),m.end(),a));
        }
        else if (s=='?')
        {
            string c;
            cin>>c;
            a=0;
            int ff=0,q=0;
            int j=c.size();
            j--;
            pair<long long ,int>p;
            p.first=-1,p.second=0;
            for (auto i:m)
            {
                if (i!=p.first)
                {
                    p.second=0;
                    q=0;
                    a=i;
                    string b;
                    while (a)
                    {
                        int e=a%10;
                        if (e%2==0)
                            b.push_back('0');
                        else
                            b.push_back('1');
                        a/=10;
                    }
                    string f;
                    reverse(b.begin(),b.end());
                    int r=b.size(),u=c.size();
                    int w=abs(r-u);
                    for (int i=0; i<w; i++)
                        f.push_back('0');
                    if (w==0)
                    {
                        if (b!=c)
                            q=1;
                    }
                    else
                    {
                        if (u<r)
                        {
                            f+=c;
                            //cout<<i<<" "<<f<<" "<<b<<endl;
                            if (f!=b)
                                q=1;
                        }
                        else
                        {
                            f+=b;
                            //cout<<i<<" "<<f<<" "<<c<<endl;
                            if (f!=c)
                                q=1;
                        }
                    }
                    if (q==0)
                    {
                        ff++;
                        p.second=1;
                    }
                    p.first=i;
                }
                else
                    ff+=p.second;
            }
            cout<<ff<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
std::multiset<long long> m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        long long a;
        if (s=='-'||s=='+')
        {
            cin>>a;
            if (s=='+')
                m.insert(a);
            else
                m.erase(lower_bound(m.begin(),m.end(),a));
        }
        else if (s=='?')
        {
            string c;
            cin>>c;
            a=0;
            int ff=0,q=0;
            int j=c.size();
            j--;
            for (auto i:m)
                {
                    q=0;
                    a=i;
                    string b;
                    while (a)
                    {
                        int e=a%10;
                        if (e%2==0)
                            b.push_back('0');
                        else
                            b.push_back('1');
                        a/=10;
                    }
                    string f;
                    reverse(b.begin(),b.end());
                    int r=b.size(),u=c.size();
                    int w=abs(r-u);
                    for (int i=0;i<w;i++)
                        f.push_back('0');
                    if (w==0)
                    {
                        if (b!=c)
                            q=1;
                    }
                    else
                    {
                        if (u<r)
                        {
                            f+=c;
                            //cout<<i<<" "<<f<<" "<<b<<endl;
                            if (f!=b)
                                q=1;
                        }
                        else
                        {
                            f+=b;
                             //cout<<i<<" "<<f<<" "<<c<<endl;
                            if (f!=c)
                                q=1;
                        }
                    }
                    if (q==0)
                        ff++;
                }
                cout<<ff<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector<long long> m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        long long a;
        if (s=='-'||s=='+')
        {
            cin>>a;
            if (s=='+')
                {
                    if (m.empty())
                        m.push_back(a);
                    else
                    {
                        m.insert(lower_bound(m.begin(),m.end(),a)-1,a);
                    }

                }
            else
                m.erase(lower_bound(m.begin(),m.end(),a));
        }
        else if (s=='?')
        {
            string c;
            cin>>c;
            a=0;
            int ff=0,q=0;
            int j=c.size();
            j--;
            pair<long long ,int>p;
            p.first=-1,p.second=0;
            for (auto i:m)
            {
                if (i!=p.first)
                {
                    p.second=0;
                    q=0;
                    a=i;
                    string b;
                    while (a)
                    {
                        int e=a%10;
                        if (e%2==0)
                            b.push_back('0');
                        else
                            b.push_back('1');
                        a/=10;
                    }
                    string f;
                    reverse(b.begin(),b.end());
                    int r=b.size(),u=c.size();
                    int w=abs(r-u);
                    for (int i=0; i<w; i++)
                        f.push_back('0');
                    if (w==0)
                    {
                        if (b!=c)
                            q=1;
                    }
                    else
                    {
                        if (u<r)
                        {
                            f+=c;
                            //cout<<i<<" "<<f<<" "<<b<<endl;
                            if (f!=b)
                                q=1;
                        }
                        else
                        {
                            f+=b;
                            //cout<<i<<" "<<f<<" "<<c<<endl;
                            if (f!=c)
                                q=1;
                        }
                    }
                    if (q==0)
                    {
                        ff++;
                        p.second=1;
                    }
                    p.first=i;
                }
                else
                    ff+=p.second;
            }
            cout<<ff<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
std::multiset<long long> m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    int n;
    cin>>n;
    while (n--)
    {
        char s;
        cin>>s;
        long long a;
        if (s=='-'||s=='+')
        {
            cin>>a;
            if (s=='+')
                m.insert(a);
            else
                m.erase(lower_bound(m.begin(),m.end(),a));
        }
        else if (s=='?')
        {
            string c;
            cin>>c;
            a=0;
            int ff=0,q=0;
            int j=c.size();
            j--;
            pair<long long ,int>p;
            p.first=-1,p.second=0;
            for (auto i:m)
            {
                if (i!=p.first)
                {
                    p.second=0;
                    q=0;
                    a=i;
                    string b;
                    while (a)
                    {
                        int e=a%10;
                        if (e%2==0)
                            b.push_back('0');
                        else
                            b.push_back('1');
                        a/=10;
                    }
                    string f;
                    reverse(b.begin(),b.end());
                    int r=b.size(),u=c.size();
                    int w=abs(r-u);
                    for (int i=0; i<w; i++)
                        f.push_back('0');
                    if (w==0)
                    {
                        if (b!=c)
                            q=1;
                    }
                    else
                    {
                        if (u<r)
                        {
                            f+=c;
                            //cout<<i<<" "<<f<<" "<<b<<endl;
                            if (f!=b)
                                q=1;
                        }
                        else
                        {
                            f+=b;
                            //cout<<i<<" "<<f<<" "<<c<<endl;
                            if (f!=c)
                                q=1;
                        }
                    }
                    if (q==0)
                    {
                        ff++;
                        p.second=1;
                    }
                    p.first=i;
                }
                else
                    ff+=p.second;
            }
            cout<<ff<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

int convert(ll x){
    string s;
    ll a=0;
    while(x){
        s+=(x%10)+'0';
        x/=10;
    }
    reverse(s.begin(),s.end());
    for (int i=0;i<s.size();i++){
        a*=10;
        a+=(s[i]-'0')&1;
    }
    return a;
}

int main()
{
    int n;
    cin>>n;
    multiset<ll> st;
    map<ll,int> mp;
    char c;
    ll x;
    for (int i=0;i<n;i++){
        cin>>c>>x;
        if (c=='+'){
            st.insert(x);
            ll a=convert(x);
            mp[a]++;
        }
        else if (c=='-'){
            st.erase(st.lower_bound(x));
            ll a=convert(x);
            mp[a]--;
        }
        else{
            cout<<mp[x]<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

int convert(ll x){
    string s;
    ll a=0;
    while(x){
        s+=(x%10)+'0';
        x/=10;
    }
    reverse(s.begin(),s.end());
    for (int i=0;i<s.size();i++){
        a*=10;
        a+=(s[i]-'0')&1;
    }
    return a;
}

int main()
{
    int n;
    cin>>n;
    multiset<ll> st;
    map<ll,int> mp;
    char c;
    ll x;
    for (int i=0;i<n;i++){
        cin>>c>>x;
        if (c=='+'){
            st.insert(x);
            int a=convert(x);
            mp[a]++;
        }
        else if (c=='-'){
            st.erase(st.lower_bound(x));
            int a=convert(x);
            mp[a]--;
        }
        else{
            cout<<mp[x]<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

int convert(int x){
    string s;
    int a=0;
    while(x){
        s+=(x%10)+'0';
        x/=10;
    }
    reverse(s.begin(),s.end());
    for (int i=0;i<s.size();i++){
        a*=10;
        a+=(s[i]-'0')&1;
    }
    return a;
}

int main()
{
    int n;
    cin>>n;
    multiset<int> st;
    map<int,int> mp;
    char c;
    int x;
    for (int i=0;i<n;i++){
        cin>>c>>x;
        if (c=='+'){
            st.insert(x);
            int a=convert(x);
            mp[a]++;
        }
        else if (c=='-'){
            st.erase(st.lower_bound(x));
            int a=convert(x);
            mp[a]--;
        }
        else{
            cout<<mp[x]<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

ll convert(ll x){
    string s;
    ll a=0;
    while(x){
        s+=(x%10)+'0';
        x/=10;
    }
    reverse(s.begin(),s.end());
    for (int i=0;i<s.size();i++){
        a*=10;
        a+=(s[i]-'0')&1;
    }
    return a;
}

int main()
{
    int n;
    cin>>n;
    map<ll,int> mp;
    char c;
    ll x;
    for (int i=0;i<n;i++){
        cin>>c>>x;
        if (c=='+'){
            ll a=convert(x);
            mp[a]++;
        }
        else if (c=='-'){
            ll a=convert(x);
            mp[a]--;
        }
        else{
            cout<<mp[x]<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

int convert(ll x){
    string s;
    ll a=0;
    while(x){
        s+=(x%10)+'0';
        x/=10;
    }
    reverse(s.begin(),s.end());
    for (int i=0;i<s.size();i++){
        a*=10;
        a+=(s[i]-'0')&1;
    }
    return a;
}

int main()
{
    int n;
    cin>>n;
    map<ll,ll> mp;
    char c;
    ll x;
    for (int i=0;i<n;i++){
        cin>>c>>x;
        if (c=='+'){
            ll a=convert(x);
            mp[a]++;
        }
        else if (c=='-'){
            ll a=convert(x);
            mp[a]--;
        }
        else{
            cout<<mp[x]<<"\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second

void fast(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}

#define ll          long long
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        '\n'
const ll MOD = 1e9+7;
#define rep(i, a, b) for(ll i=a; i<b; ++i)
#define repe(i, a, b) for(ll i=a; i<=b; ++i)
#define jrep(i, a, b, c) for(ll i=a; i<b; i+=c)
#define jrepe(i, a, b, c) for(ll i=a;i<=b; i+=c)
#define inp(i, n, a) for(ll i=0;i<n;i++) cin>>a[i];

int main()
{
    //fast();
  ll n;
  cin>>n;
  //cout<<"ahs\n";
  //cout<<n;
  ll a[n];
  ll b[n];
  rep(i,0,n){
  cin>>a[i];
  }
  rep(i,0,n)
  {
      cin>>b[i];
  }
  //cout<<"addd\n";
  ll c[n];
  vi va;
  vi vb;
  ll gd;
  //cout<<"aj\n";
  map<pii,ll>ma;
  mi mb,i;
  rep(i,0,n)
  {
      //cout<<"lk\n";
      gd=__gcd(a[i],b[i]);
      b[i]=b[i]/gd;
      a[i]=a[i]/gd;
      ma[{a[i],b[i]}]++;
     // mb[b[i]]++;
     /* if(ma[a[i]]==1)
        va.puba(a[i]);
      if(mb[b[i]]==1)
        vb.puba(b[i]);*/
        //cout<<"dfg\n";
  }
  ll fa,fb,f;
  ll mx=-1;
  ll t1,t2;
  //cout<<"a\n";
  rep(i,0,n)
  {
      /*fa=ma[a[i]];
      fb=mb[b[i]];
      f=min(fa,fb);
      */
      //cout<<"sdds\n";
      f=ma[{a[i],b[i]}];
      if(f>mx)
      {
          t1=a[i];
          t2=b[i];
          mx=f;
      }
  }
  //cout<<"pk\n";
  ll ans=0;
  if(t2==0||t1==0)
  {
      cout<<0;
      return 0;
  }
  rep(i,0,n)
  {
      //cout<<"ans\n";
      //c[i]=((a[i])*(-t2))/t1+b[i];
      //cout<<c[i];
      //cout<<a[i]<<" "<<b[i];
      //cout<<a[i]<<" "b[i]<<" "<<-t2<<" "<<t1<<endl;
      //cout<<-t2<<" "<<t1<<endl;
      if(((a[i])*(-t2))/t1+b[i]==0&&(floor((double(a[i])*(-t2))/t1)+b[i])==(ceil((double (a[i])*(-t2))/t1)+b[i]))
        ans++;
       // cout<<ans;
  }
  cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second

void fast(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}

#define ll          long long
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        '\n'
const ll MOD = 1e9+7;
#define rep(i, a, b) for(ll i=a; i<b; ++i)
#define repe(i, a, b) for(ll i=a; i<=b; ++i)
#define jrep(i, a, b, c) for(ll i=a; i<b; i+=c)
#define jrepe(i, a, b, c) for(ll i=a;i<=b; i+=c)
#define inp(i, n, a) for(ll i=0;i<n;i++) cin>>a[i];

int main()
{
    //fast();
  ll n;
  cin>>n;
  //cout<<"ahs\n";
  //cout<<n;
  ll a[n];
  ll b[n];
  rep(i,0,n){
  cin>>a[i];
  }
  rep(i,0,n)
  {
      cin>>b[i];
  }
  //cout<<"addd\n";
  ll c[n];
  vi va;
  vi vb;
  ll gd;
  //cout<<"aj\n";
  map<pii,ll>ma;
  mi mb,i;
  rep(i,0,n)
  {
      //cout<<"lk\n";
      if(a[i]!=0&&b[i]!=0){
      gd=__gcd(a[i],b[i]);
      b[i]=b[i]/gd;
      a[i]=a[i]/gd;
      ma[{a[i],b[i]}]++;
      }
      else
      {
          mp[{a[i],b[i]}]++;
      }
     // mb[b[i]]++;
     /* if(ma[a[i]]==1)
        va.puba(a[i]);
      if(mb[b[i]]==1)
        vb.puba(b[i]);*/
        //cout<<"dfg\n";
  }
  ll fa,fb,f;
  ll mx=-1;
  ll t1=0,t2=0;
  //cout<<"a\n";
  rep(i,0,n)
  {
      /*fa=ma[a[i]];
      fb=mb[b[i]];
      f=min(fa,fb);
      */
      //cout<<"sdds\n";
      f=ma[{a[i],b[i]}];
      if(f>mx)
      {
          t1=a[i];
          t2=b[i];
          mx=f;
      }
  }
  //cout<<"pk\n";
  ll ans=0;
  if(t2==0||t1==0)
  {

      cout<<ma[{0,0}];
      return 0;
  }
  rep(i,0,n)
  {
      //cout<<"ans\n";
      //c[i]=((a[i])*(-t2))/t1+b[i];
      //cout<<c[i];
      //cout<<a[i]<<" "<<b[i];
      //cout<<a[i]<<" "b[i]<<" "<<-t2<<" "<<t1<<endl;
      //cout<<-t2<<" "<<t1<<endl;
      if(((a[i])*(-t2))/t1+b[i]==0&&(floor((double(a[i])*(-t2))/t1)+b[i])==(ceil((double (a[i])*(-t2))/t1)+b[i]))
        ans++;
       // cout<<ans;
  }
  cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second

void fast(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}

#define ll          long long
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        '\n'
const ll MOD = 1e9+7;
#define rep(i, a, b) for(ll i=a; i<b; ++i)
#define repe(i, a, b) for(ll i=a; i<=b; ++i)
#define jrep(i, a, b, c) for(ll i=a; i<b; i+=c)
#define jrepe(i, a, b, c) for(ll i=a;i<=b; i+=c)
#define inp(i, n, a) for(ll i=0;i<n;i++) cin>>a[i];

int main()
{
    //fast();
  ll n;
  cin>>n;
  //cout<<"ahs\n";
  //cout<<n;
  ll a[n];
  ll b[n];
  rep(i,0,n){
  cin>>a[i];
  }
  rep(i,0,n)
  {
      cin>>b[i];
  }
  ll ss;
  //cout<<"addd\n";
  ll c[n];
  vi va;
  vi vb;
  ll gd;
  //cout<<"aj\n";
  map<pii,ll>ma;
  mi mb,i;
  rep(i,0,n)
  {
      //cout<<"lk\n";
      if(a[i]!=0&&b[i]!=0){
      gd=__gcd(a[i],b[i]);
      b[i]=b[i]/gd;
      a[i]=a[i]/gd;
      ma[{a[i],b[i]}]++;
      }
      else
      {
          ss++;
      }
     // mb[b[i]]++;
     /* if(ma[a[i]]==1)
        va.puba(a[i]);
      if(mb[b[i]]==1)
        vb.puba(b[i]);*/
        //cout<<"dfg\n";
  }
  ll fa,fb,f;
  ll mx=-1;
  ll t1=0,t2=0;
  //cout<<"a\n";
  rep(i,0,n)
  {
      /*fa=ma[a[i]];
      fb=mb[b[i]];
      f=min(fa,fb);
      */
      //cout<<"sdds\n";
      f=ma[{a[i],b[i]}];
      if(f>mx&&a[i]!=0)
      {
          t1=a[i];
          t2=b[i];
          mx=f;
      }
  }
  //cout<<"pk\n";

  cout<<mx+ss;

 }


#include<iostream>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(int)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

ll gcd(ll a, ll b) {		// ユークリッドの互除法
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll extgcd(ll a, ll b, ll& x, ll& y) {		// 拡張ユークリッドの互除法
	ll d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	} else {
		x = 1; y = 0;
	}
	return d;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin >> n;
	vector<ll> a(n), b(n);
	REP(i, n) cin >> a[i];
	REP(i, n) cin >> b[i];
	map<pair<ll, pll>, ll> m;
	ll ans = 0;
	REP(i, n) {
		if(a[i] == 0) {
			if(b[i] == 0) ans++;
		} else if(b[i] == 0) {
			m[{0, pll(1, 0)}]++;
		} else {
			int d = a[i] * b[i] < 0;
			a[i] = abs(a[i]);
			b[i] = abs(b[i]);
			ll g = gcd(a[i], b[i]);
			m[{d, pll(a[i] / g, b[i] / g)}]++;
		}
	}
	ll tmp = 0;
	for(auto x: m) {
		tmp = max(tmp, x.second);
	}
	cout << ans + tmp << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second

void fast(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}

#define ll          long long
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        '\n'
const ll MOD = 1e9+7;
#define rep(i, a, b) for(ll i=a; i<b; ++i)
#define repe(i, a, b) for(ll i=a; i<=b; ++i)
#define jrep(i, a, b, c) for(ll i=a; i<b; i+=c)
#define jrepe(i, a, b, c) for(ll i=a;i<=b; i+=c)
#define inp(i, n, a) for(ll i=0;i<n;i++) cin>>a[i];

int main()
{
    //fast();
  ll n;
  cin>>n;
  //cout<<"ahs\n";
  //cout<<n;
  ll a[n];
  ll b[n];
  rep(i,0,n){
  cin>>a[i];
  }
  rep(i,0,n)
  {
      cin>>b[i];
  }
  ll ss;
  //cout<<"addd\n";
  ll c[n];
  vi va;
  vi vb;
  ll gd;
  //cout<<"aj\n";
  map<pii,ll>ma;
  mi mb,i;
  rep(i,0,n)
  {
      //cout<<"lk\n";
      if(a[i]!=0&&b[i]!=0){
      gd=__gcd(a[i],b[i]);
      b[i]=b[i]/gd;
      a[i]=a[i]/gd;
      ma[{a[i],b[i]}]++;
      }
      else
      {
          ss++;
      }
     // mb[b[i]]++;
     /* if(ma[a[i]]==1)
        va.puba(a[i]);
      if(mb[b[i]]==1)
        vb.puba(b[i]);*/
        //cout<<"dfg\n";
  }
  ll fa,fb,f;
  ll mx=-1;
  ll t1=0,t2=0;
  //cout<<"a\n";
  rep(i,0,n)
  {
      /*fa=ma[a[i]];
      fb=mb[b[i]];
      f=min(fa,fb);
      */
      //cout<<"sdds\n";
      f=ma[{a[i],b[i]}];
      if(f>mx)
      {
          t1=a[i];
          t2=b[i];
          mx=f;
      }
  }
  //cout<<"pk\n";
  ll ans=0;
  if(t1==0)
  {

      cout<<ss;
      return 0;
  }
  rep(i,0,n)
  {
      //cout<<"ans\n";
      //c[i]=((a[i])*(-t2))/t1+b[i];
      //cout<<c[i];
      //cout<<a[i]<<" "<<b[i];
      //cout<<a[i]<<" "b[i]<<" "<<-t2<<" "<<t1<<endl;
      //cout<<-t2<<" "<<t1<<endl;
      if(((a[i])*(-t2))/t1+b[i]==0&&(floor((double(a[i])*(-t2))/t1)+b[i])==(ceil((double (a[i])*(-t2))/t1)+b[i]))
        ans++;
       // cout<<ans;
  }
  cout<<ans+ss;

 }


#include <bits/stdc++.h>
using namespace std;
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second

void fast(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}

#define ll          long long
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        '\n'
const ll MOD = 1e9+7;
#define rep(i, a, b) for(ll i=a; i<b; ++i)
#define repe(i, a, b) for(ll i=a; i<=b; ++i)
#define jrep(i, a, b, c) for(ll i=a; i<b; i+=c)
#define jrepe(i, a, b, c) for(ll i=a;i<=b; i+=c)
#define inp(i, n, a) for(ll i=0;i<n;i++) cin>>a[i];

int main()
{
    //fast();
  ll n;
  cin>>n;
  //cout<<"ahs\n";
  //cout<<n;
  ll a[n];
  ll b[n];
  rep(i,0,n){
  cin>>a[i];
  }
  rep(i,0,n)
  {
      cin>>b[i];
  }
  //cout<<"addd\n";
  ll c[n];
  vi va;
  vi vb;
  ll gd;
  //cout<<"aj\n";
  map<pii,ll>ma;
  mi mb,i;
  rep(i,0,n)
  {
      //cout<<"lk\n";
      if(a[i]!=0&&b[i]!=0){
      gd=__gcd(a[i],b[i]);
      b[i]=b[i]/gd;
      a[i]=a[i]/gd;
      ma[{a[i],b[i]}]++;
      }
     // mb[b[i]]++;
     /* if(ma[a[i]]==1)
        va.puba(a[i]);
      if(mb[b[i]]==1)
        vb.puba(b[i]);*/
        //cout<<"dfg\n";
  }
  ll fa,fb,f;
  ll mx=-1;
  ll t1=0,t2=0;
  //cout<<"a\n";
  rep(i,0,n)
  {
      /*fa=ma[a[i]];
      fb=mb[b[i]];
      f=min(fa,fb);
      */
      //cout<<"sdds\n";
      f=ma[{a[i],b[i]}];
      if(f>mx)
      {
          t1=a[i];
          t2=b[i];
          mx=f;
      }
  }
  //cout<<"pk\n";
  ll ans=0;
  if(t2==0||t1==0)
  {

      cout<<ma[{0,0}];
      return 0;
  }
  rep(i,0,n)
  {
      //cout<<"ans\n";
      //c[i]=((a[i])*(-t2))/t1+b[i];
      //cout<<c[i];
      //cout<<a[i]<<" "<<b[i];
      //cout<<a[i]<<" "b[i]<<" "<<-t2<<" "<<t1<<endl;
      //cout<<-t2<<" "<<t1<<endl;
      if(((a[i])*(-t2))/t1+b[i]==0&&(floor((double(a[i])*(-t2))/t1)+b[i])==(ceil((double (a[i])*(-t2))/t1)+b[i]))
        ans++;
       // cout<<ans;
  }
  cout<<ans;

 }


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        else if(!b[i])
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
        if(!a[i] || !b[i])
            continue;
        long long gcd = __gcd(b[i],a[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(- b[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans=max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        long long gcd = abs(__gcd(a[i],b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(a[i], b[i])]++;
        ans = max(ans,mp[make_pair(a[i], b[i])]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
//        if(!a[i] && !b[i])
//            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i])
            continue;
        long long gcd = abs(__gcd(a[i],b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(a[i], b[i])]++;
        ans = max(ans,mp[make_pair(a[i], b[i])]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
//        if(!b[i]){
//            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
//            continue;
//        }
        long long gcd = __gcd(a[i],-b[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if(- b[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<long double,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i])
            continue;
        long double d = (long double)(-b[i]) / (long double) (a[i]);
        mp[d]++,ans = max(ans,mp[d]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        else if(!b[i])
            mp[{0,0}]++;
        if(!a[i] || !b[i])
            continue;
        long long gcd = __gcd(b[i],a[i]);
        a[i] /= gcd, b[i] /=gcd;
        if(b[i]<0)
            a[i] *= -1, b[i] *= -1;
        else if(b[i] == 0 && a[i] < 0)
            a[i] *= -1;
        mp[{b[i], a[i]}]++;
//        ans = max(ans,mp[{b[i], a[i]}]);
    }
    for(auto i : mp)
        ans = max(ans,i.second);
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i])
            ok = 0;
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
//    if(!ok)
//        ans = 0;
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
//        if(!b[i]){
//            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
//            continue;
//        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[{-b[i], a[i]}]++;
        ans = max(ans,mp[{-b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if(- b[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
//        if(- b[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{-b[i], a[i]}]++;
        ans = max(ans,mp[{-b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        else if(!b[i])
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
        if(!a[i] || !b[i])
            continue;
        long long gcd = __gcd(b[i],a[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
//        if(!b[i]){
//            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
//            continue;
//        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if(b[i] < 0 )
            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],-b[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if(- b[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{-b[i], a[i]}]++;
        ans = max(ans,mp[{-b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[{-b[i], a[i]}]++;
        ans = max(ans,mp[{-b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i])
            ok = 0;
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
//    if(!ok)
//        ans = 0;
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(b[i] < 0 )
            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{1e9,0}]++,ans=max(ans,mp[{1e9,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        if(!b[i])
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
        else{
            mp[make_pair(a[i], b[i])]++;
            ans = max(ans,mp[make_pair(a[i], b[i])]);
        }
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        else if(!b[i])
            mp[{0,0}]++;
        if(!a[i] || !b[i])
            continue;
        long long gcd = __gcd(b[i],a[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
//        ans = max(ans,mp[{b[i], a[i]}]);
    }
    for(auto i : mp)
        ans = max(ans,i.second);
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] || ! b[i])
            continue;
        long long gcd = abs(__gcd(a[i],b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(a[i], b[i])]++;
        ans = max(ans,mp[make_pair(a[i], b[i])]);
    }
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,ans,a[200005],b[100005];
map<pair<int,int>,int>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i])
            ok = 0;
        if(!a[i] && !b[i])
            mp[{-1,-1}]++,ans =max(ans,mp[{-1,-1}]);
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = abs(__gcd(a[i],-b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[make_pair(-b[i], a[i])]++;
        ans = max(ans,mp[make_pair(-b[i], a[i])]);
    }
    if(!ok)
        ans = 0;
    cout<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if( -b[i] < 0 || -b[i] == 0 && a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{-b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<long double,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i] || !b[i])
            continue;
        long double d = (long double)-b[i] / (long double)a[i];
        mp[d]++;
    }
    for(auto i : mp)
        ans = max(ans,i.second);
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[200005];
map<long double,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i] || !b[i])
            continue;
        long double d = (long double)-b[i] / (long double)a[i];
        mp[d]++;
    }
    for(auto i : mp)
        ans = max(ans,i.second);
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
//        if(!b[i]){
//            mp[{0,0}]++,ans=max(ans,mp[{0,0}]);
//            continue;
//        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
//        if(- b[i] < 0)
//            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        else if(!b[i])
            mp[{0,0}]++;
        if(!a[i] || !b[i])
            continue;
        long long gcd = __gcd(b[i],a[i]);
        a[i] /= gcd, b[i] /=gcd;
        if(b[i]<0)
            a[i] *= -1, b[i] *= -1;
//        else if(b[i] == 0 && a[i] < 0)
//            a[i] *= -1;
        mp[{b[i], a[i]}]++;
//        ans = max(ans,mp[{b[i], a[i]}]);
    }
    for(auto i : mp)
        ans = max(ans,i.second);
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[200005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        long long gcd = abs(__gcd(a[i],b[i]));
        a[i] /= gcd, b[i] /=gcd;
        if(b[i] < 0  || !b[i] && a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{1e9,0}]++,ans=max(ans,mp[{1e9,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,x,ans,a[200005],b[100005];
map<pair<long long,long>,long long>mp;
bool ok = 1;
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
        cin>>b[i];
    for(int i=0; i<n; i++){
        if(!a[i] && !b[i])
            x++;
        if(!a[i])
            continue;
        if(!b[i]){
            mp[{1e9,0}]++,ans=max(ans,mp[{1e9,0}]);
            continue;
        }
        long long gcd = __gcd(a[i],b[i]);
        a[i] /= gcd, b[i] /=gcd;
        if(a[i] < 0)
            a[i] *= -1, b[i] *= -1;
        mp[{b[i], a[i]}]++;
        ans = max(ans,mp[{b[i], a[i]}]);
    }
    cout<<ans + x<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];

	map<double,ll> hash;
	for(i=0;i<n;i++)
	{
		if(a[i]!=0)
		hash[b[i]/a[i]]++;
	}
	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}
	for(itr=hash.begin();itr!=hash.end();itr++)
	{

			if(itr->f==0)
			maxx++;
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];
	ll ans=0;
	map<double,ll> hash;
	for(i=0;i<n;i++)
	{
		if(b[i]==0)
			ans++;

		if(a[i]!=0)
		hash[b[i]/a[i]]++;
	}
	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	long double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	long double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<long double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<long double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];

	map<double,ll> hash;
	for(i=0;i<n;i++)
	{
		hash[a[i]/b[i]]++;
	}
	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{
		if(itr->f!=0)
		if(itr->s>maxx)
			maxx=itr->s;
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];
	ll ans=0;
	map<double,ll> hash;
	for(i=0;i<n;i++)
	{
		if(b[i]==0)
			ans++;

		if(a[i]!=0 || b[i]!=0)
		hash[b[i]/a[i]]++;
	}
	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
long double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	long double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<long double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
			hash[b[i]/a[i]]++;

	}

	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];

	map<double,ll> hash;
	for(i=0;i<n;i++)
	{
		if(a[i]!=0)
		hash[b[i]/a[i]]++;
	}
	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx)
			maxx=itr->s;
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];
	double b[n];
	for(i=0;i<n;i++)
		cin>>b[i];
	ll ans=0;
	map<double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0)
			ans++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;
	}

	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}
	maxx+=ans;
	cout<<maxx<<endl;
}


//

 _|    _|                               _|                      _|
 _|  _|       _|_|_|   _|_|_|  _|_|     _|_|_|       _|_|
 _|_|       _|    _|   _|    _|    _|   _|    _|   _|    _|     _|
 _|  _|     _|    _|   _|    _|    _|   _|    _|   _|    _|     _|
 _|    _|     _|_|_|   _|    _|    _|   _|_|_|       _|_|       _|
                                                                _|
                                                              _|
//

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	long double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	long double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<long double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<long double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	long double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	long double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;
	ll ans1=0;
	map<long double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0 && a[i]==0)
			ans++;

		if(b[i]==0 && a[i]!=0)
			ans1++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<long double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(ans1,maxx);
	maxx+=ans;
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vc vector <ll>
#define f first
#define s second
#define mp make_pair
#define pairll pair<ll,ll>
#define mapitr map<ll,ll> ::iterator
#define inf 99999999999999
#define mod 1000000007
using namespace std;
main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin>>n;
	double a[n];
	ll i;
	for(i=0;i<n;i++)
		cin>>a[i];

	double b[n];

	for(i=0;i<n;i++)
		cin>>b[i];

	ll ans=0;

	map<double,ll> hash;

	for(i=0;i<n;i++)
	{
		if(b[i]==0)
			ans++;

		if(a[i]!=0 && b[i]!=0)
		hash[b[i]/a[i]]++;

	}

	map<double,ll> :: iterator itr=hash.begin();
	ll maxx=0;
	for(;itr!=hash.end();itr++)
	{

		if(itr->s>maxx && itr->f!=0)
			maxx=itr->s;
	}

	maxx=max(maxx,ans);
	cout<<maxx<<endl;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            c[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            c[0]++;
            k=5;
        }

    }
    for1(i,N+2)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<e[i]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<f[i]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
    }
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
        Max+=c[0];
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            c[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            c[0]++;
            k=5;
        }
    }
    for1(i,20)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<e[i]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<f[i]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
    }
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
        Max+=c[0];
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0,l=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            e[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            e[0]++;
            k=5;
        }

    }
    for1(i,20)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<ne[i-1]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<nf[i-1]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
        if(e[i]!=0 || f[i]!=0 || ne[i]!=0 || nf[i]!=0)
            l=5;
        //cout<<l<<endl;
    }
    if(l==0)
        k=0;
    //cout<<k<<endl;
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
    {
        Max+=e[0];
    }
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            c[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            c[0]++;
            k=5;
        }
        else if(a[i]==0 && b[i]!=0)
        {
            continue;
        }
    }
    for1(i,20)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<e[i]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<f[i]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
    }
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
        Max+=c[0];
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0,l=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            e[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            e[0]++;
            k=5;
        }

    }
    for1(i,N-2)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<e[i]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<f[i]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
        if(e[i]!=0)
            l=5;
    }
    if(l==0)
        k=0;
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
    {
        Max+=c[0];
    }
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],c[N],d[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            c[i]=a[i]/b[i];
            if(c[i]<0)
            {
                c[i]=c[i]*(-1);
                ne[c[i]]++;
            }
            else
                e[c[i]]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            d[i]=b[i]/a[i];
            if(d[i]<0)
            {
                d[i]=d[i]*(-1);
                nf[d[i]]++;
            }
            else
                f[d[i]]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            c[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            c[0]++;
            k=5;
        }

    }
    for1(i,N-2)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<e[i]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<f[i]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
    }
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
    {
        if(Max!=c[0])
            Max+=c[0];
    }
    cout<<Max<<endl;
	return 0;
}


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

#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

ll a[N],b[N],e[N],f[N],ne[N],nf[N];
int main()
{
    ll n,i,Max1=0,Max2=0,Max3=0,Max4=0,Max=0,k=0,l=0,x;
    cin>>n;
    for1(i,n)
        cin>>a[i];

    for1(i,n)
        cin>>b[i];

    for1(i,n)
    {
        if(b[i]!=0 && a[i]!=0 && a[i]%b[i]==0)
        {
            x=a[i]/b[i];
            if(x<0)
            {
                x=x*(-1);
                ne[ x ]++;
            }
            else
                e[ x ]++;
            //cout<<c[i]<<endl;
        }
        else if(a[i]!=0 && b[i]%a[i]==0)
        {
            x=b[i]/a[i];
            if(x<0)
            {
                x=x*(-1);
                nf[ x ]++;
            }
            else
                f[ x ]++;
            //cout<<d[i]<<endl;
        }
        else if(a[i]!=0 && b[i]==0)
        {
            e[0]++;
        }
        else if(a[i]==0 && b[i]==0)
        {
            e[0]++;
            k=5;
        }

    }
    for1(i,N-2)
    {
        Max1=max(Max1,e[i-1]);
        //cout<<"E--  "<<ne[i-1]<<" "<<e[i-1]<<endl;
        Max2=max(Max2,f[i-1]);
        //cout<<"F--  "<<nf[i-1]<<" "<<f[i-1]<<endl;
        //cout<<Max1<<" "<<Max2<<endl;
        Max3=max(Max3,ne[i-1]);
        Max4=max(Max4,nf[i-1]);
        if(e[i]!=0 || f[i]!=0 || ne[i]!=0 || nf[i]!=0)
            l=5;
        //cout<<l<<endl;
    }
    if(l==0)
        k=0;
    //cout<<k<<endl;
    Max=max3(Max,Max1,Max2);
    Max=max3(Max,Max4,Max3);
    if(k==5)
    {
        Max+=e[0];
    }
    cout<<Max<<endl;
	return 0;
}