#include <bits/stdc++.h>
using namespace std;
template <class T>
void input(T &x) {
  char c = getchar();
  x = 0;
  for (; (c < 48 || c > 57); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
}
inline long long bigmod(long long p, long long e, long long M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
const int N = 5e5 + 5;
int T[5 * N];
int Range[N];
int n;
int dis;
int P[N][22];
int iMin[N][22];
const int LOG = 20;
void build(int n, int b, int e) {
  if (b == e) {
    T[n] = b;
    return;
  }
  int mid = (b + e) / 2;
  build(((n) << 1), b, mid);
  build(((n) << 1 | 1), mid + 1, e);
  if (Range[T[((n) << 1)]] <= Range[T[((n) << 1 | 1)]])
    T[n] = T[((n) << 1)];
  else
    T[n] = T[((n) << 1 | 1)];
}
int query(int n, int b, int e, int i, int j) {
  if (b >= i && e <= j) return T[n];
  int mid = (b + e) / 2;
  if (i > mid)
    return query(((n) << 1 | 1), mid + 1, e, i, j);
  else if (j <= mid)
    return query(((n) << 1), b, mid, i, j);
  else {
    int x = query(((n) << 1), b, mid, i, j),
        y = query(((n) << 1 | 1), mid + 1, e, i, j);
    return Range[x] <= Range[y] ? x : y;
  }
}
int main() {
  input(n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &dis);
    Range[i] = max(1, i - dis);
    Range[n + i] = max(1, n + i - dis);
    iMin[i][0] = Range[i];
    iMin[n + i][0] = Range[n + i];
  }
  build(1, 1, 2 * n);
  P[1][0] = 1;
  for (int i = 2; i <= 2 * n; i++) {
    P[i][0] = query(1, 1, 2 * n, Range[i], i - 1);
  }
  for (int j = 1; j < LOG; j++) {
    for (int i = 1; i <= 2 * n; i++) {
      P[i][j] = P[P[i][j - 1]][j - 1];
      iMin[i][j] = iMin[P[i][j - 1]][j - 1];
    }
  }
  long long ans = 0;
  for (int i = n + 1; i <= 2 * n; i++) {
    int now = i;
    int dest = i - n + 1;
    int res = 0;
    for (int j = LOG - 1; j >= 0; j--) {
      if (iMin[now][j] > dest) {
        now = P[now][j];
        res += (1 << j);
      }
    }
    res++;
    ans += res;
  }
  cout << ans << endl;
}
