#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
int i, j, n, m;
int a[100000], dp[100000];
int q[100000], bg, ed;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int l = 1; l <= n; l++) {
    for (i = 2; i <= n; i++) dp[i] = inf;
    bg = ed = 0;
    q[ed++] = 1;
    for (i = 2; i <= n; i++) {
      int l = bg, r = ed - 1, x = i - a[i];
      while (r - l > 0) {
        int mid = ((l + r) >> 1);
        if (q[mid] < x)
          l = mid + 1;
        else
          r = mid;
      }
      dp[i] = dp[q[l]] + 1;
      while (bg < ed && dp[i] <= dp[q[ed - 1]]) ed--;
      q[ed++] = i;
    }
    ans += dp[n];
    int tmp = a[n];
    for (i = n; i >= 2; i--) a[i] = a[i - 1];
    a[1] = tmp;
  }
  printf("%d\n", ans);
  return 0;
}
