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

int N;
int a[100001];

int deg[100001] = {0};

// topological sort
int main(){
	scanf("%d",&N);
	for(int i = 0; i < N; i++){
		scanf("%d",&a[i]);
		deg[(i+a[i])%N]++;
	}
	
	queue<int> q;
	for(int i = 0; i < N; i++){
		if(deg[i] == 0){
			q.push(i);
		}
	}
	int ans = N;
	while(!q.empty()){
		int t = q.front(); q.pop();
		int idx = (t+a[t])%N;
		deg[idx]--;
		if(deg[idx] == 0){
			q.push(idx);
		}
		ans--;
	}
	printf("%d\n", ans);

	return 0;
}

