#include <bits/stdc++.h>
using namespace std;
int dp[310];
vector<int> a;
int main() {
  int n;
  scanf("%d", &n);
  a.resize(n);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i]);
  int res = 0;
  for (int it = (0); it < (n); ++it) {
    dp[n - 1] = 0;
    for (int i = n - 2; i >= 0; --i) {
      dp[i] = 2000000000;
      for (int j = (i + 1); j < (n); ++j)
        if (i >= j - a[j])
          dp[i] = ((dp[i] < 1 + dp[j]) ? (dp[i]) : (1 + dp[j]));
    }
    res += dp[0];
    int v = a.back();
    a.pop_back();
    a.insert(a.begin(), v);
  }
  cout << res << endl;
  return 0;
}
