#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 310;
int d[maxn][maxn];
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  const int cinf = 10000000;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) d[i][j] = (i != j) * cinf;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      if (i != j) {
        int t = j;
        if (i > t) t += n;
        if (i >= t - a[j]) d[i][j] = 1;
      }
    }
  for (int k = 0; k < n; ++k)
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += d[i][(i - 1 + n) % n];
  }
  printf("%d\n", ans);
  return 0;
}
