#include <bits/stdc++.h>
using namespace std;
int n, r[611], *x;
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &r[i]);
  for (int i = 1; i <= n; ++i) r[n + i] = r[i];
}
int ans(0), f[311];
void work() {
  for (int k = 1; k <= n; ++k) {
    x = r + k;
    memset(f, 70, sizeof(f));
    f[1] = 0;
    for (int i = 2; i <= n; ++i)
      for (int j = max(1, i - x[i]); j < i; ++j) f[i] = min(f[i], f[j] + 1);
    ans += f[n];
  }
  printf("%d\n", ans);
}
int main() {
  init();
  work();
  return 0;
}
