#include <bits/stdc++.h>
using namespace std;
int main(void){
    int cnt;
    string S;
    string buf,zone = "ZONe";
    cin >> S;
    
    for(int i=0;i<9;i++){
        buf = S.substr(i,4);
        if(buf==zone){
            cnt++;
        }
    }
    
    cout << cnt << endl;
}

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<cctype>
#include<cstdlib>
#include<map>
#include<algorithm>
#include<set>
#define fs(i,x,y) for(int i=(x),_=(y);i<=_;++i)
#define fn(i,x,y) for(int i=(x),_=(y);i>=_;--i)
#define tor(i,v,x) for(int i=head[x],v=to[i];i;i=nxt[i],v=to[i])
#define Li inline
#define R register int
#define ls(x) ch[x][0]
#define rs(x) ch[x][1]
#define mpi(x,y) make_pair(x,y)
#define pi pair<int,int>
//#define int ll
#define DEBUG printf("HHHH,%d\n",__LINE__)
using namespace std;
typedef long long ll;
template<typename T>
void read(T &x){
	x=0;char ch=getchar();bool f=0;
	while(ch<'0'||ch>'9'){
		if(ch=='-')f=1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
	x=f?-x:x;
}

const int N=2e3+7;
int n,m;
int a[N];
set<int>b;

int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}

void fctize(int x){
	int sqr=sqrt(x);
	fs(i,1,sqr){
		if(x%i==0){
			b.insert(i);
			b.insert(x/i);
		}
	}
}

signed main(){
	read(n);fs(i,1,n){
		read(a[i]);fctize(a[i]);
	}
	int ans=0;
//	cout<<tot<<endl;
	for(auto v:b){
		int now=0,mn=1e9+7;
		fs(j,1,n){
			if(a[j]%v==0)now=gcd(a[j],now);
			else mn=min(mn,a[j]);
		}
		if(now==v&&v<=mn)++ans;
	}
	cout<<ans;
	return 0;
}
