#include <bits/stdc++.h>
using namespace std;
int n, cur, t, ret;
int a[10005], suf[10005], mn[10005];
int main() {
  scanf("%d", &n);
  for (int i = (0); i < (n); i++) scanf("%d", &a[i]);
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (n); j++) mn[j] = j - a[j];
    suf[n] = n;
    for (int j = (n)-1; j >= (0); j--) suf[j] = min(suf[j + 1], mn[j]);
    cur = 0;
    while (cur < n - 1) {
      t = cur + 1;
      while (t + 1 < n && suf[t + 1] <= cur) ++t;
      ret++;
      cur = t;
    }
    rotate(a, a + 1, a + n);
  }
  printf("%d\n", ret);
  return 0;
}
