#include <bits/stdc++.h>
using namespace std;
const int MAXN = 700;
int n, a[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i + n] = a[i];
  }
  int res = 0;
  for (int i = n; i < n + n; i++) {
    int lower = i, cnt = 0;
    while (lower > i - n + 1) {
      cnt++;
      for (int j = lower; j <= i; j++) {
        lower = min(lower, j - a[j]);
      }
    }
    res += cnt;
  }
  printf("%d\n", res);
  return 0;
}
