#include <bits/stdc++.h>

using namespace std;

int n;
vector<int> na,cnt;

int solve() {
  int res=n;
  queue<int> q;
  for(int i=0;i<n;++i)
    if(cnt[i]==0) q.push(i);
  while(!q.empty()) {
    int e=q.front(); q.pop();
    cnt[na[e]]--; res--;
    if(cnt[na[e]]==0) q.push(na[e]);
  }
  return res;
}

int main(){
  cin >> n;
  na.resize(n);
  cnt.assign(n,0);
  for(int i=0;i<n;++i) {
    int a; cin >> a;
    na[i]=(i+a)%n;
    cnt[na[i]]++;
  }
  cout << solve() << endl;
  
  return 0;
}

