#include #define rep(i,n) for(int i=0;i ; const int INF = 1e9; const int MOD = 1000000007; ll gcd(ll i,ll j){ if(j == 0) return i; return gcd(j,i%j); } int main(){ int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; ll ans = 0; map dp1; map dp2; dp1[a[0]] = 1; if(a[0] ==1) ++ans; for(int i=1;i empty; swap(empty,dp2); //cout << ans << endl; } cout << ans << endl; return 0; }