#include <bits/stdc++.h>
using namespace std;
int a[301], b[301];
int main() {
  int n, k, sum = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) b[i] = i;
  int cur;
  for (int i = 1; i <= n; i++) {
    cur = 1;
    while (1) {
      for (int j = n; j > cur; j--)
        if (cur >= j - a[b[j]]) {
          cur = j;
          ++sum;
          break;
        }
      if (cur == n) break;
    }
    for (int j = 1; j <= n; j++) {
      b[j] = b[j] - 1;
      if (b[j] == 0) b[j] = n;
    }
  }
  cout << sum;
}
