#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:500000000")
using namespace std;
const int ppow = 1 << 10;
int t[ppow * 2];
void Set(int pos, int val) {
  pos += ppow;
  t[pos] = val;
  pos /= 2;
  while (pos > 0) {
    t[pos] = min(t[pos * 2], t[pos * 2 + 1]);
    pos /= 2;
  }
}
int Min(int L, int R) {
  int res = 0x3F3F3F3F;
  L += ppow;
  R += ppow;
  while (L <= R) {
    if (L & 1) res = min(res, t[L++]);
    if (~R & 1) res = min(res, t[R--]);
    L /= 2;
    R /= 2;
  }
  return res;
}
int A[309];
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  int cnt = 0;
  for (j = 0; j < n; j++) {
    memset(t, 63, sizeof(t));
    Set(0, 0);
    for (i = 1; i < n; i++) {
      Set(i, 1 + Min(max(0, i - A[i]), i - 1));
    }
    cnt += Min(n - 1, n - 1);
    int tmp = A[n - 1];
    for (i = n - 1; i > 0; i--) A[i] = A[i - 1];
    A[0] = tmp;
  }
  printf("%d\n", cnt);
}
