#include <bits/stdc++.h>
using namespace std;
int mas[301], n;
int res(int i) {
  int p = n - 1, k = 0, m = 0;
  bool flag = true;
  while (flag) {
    p = n - 1;
    int x = p - i;
    if (x < 0) x = n - 1 + x;
    while (p > m && m < p - mas[x]) {
      p--;
      x--;
      if (x < 0) x = n - 1;
    }
    k++;
    m = p;
    if (m == n - 1) flag = false;
  }
  return k;
}
int main() {
  int i, ans = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> mas[i];
  for (i = 0; i < n; i++) {
    ans += res(i);
  }
  cout << ans << endl;
  return 0;
}
