#include <bits/stdc++.h>
const size_t maxN = 500005;
int N, A[maxN];
int ST[19][maxN], Lg[maxN] = {-1};
int Fa[19][maxN];
inline int RMQ_min(int x, int y) { return x - A[x] > y - A[y] ? y : x; }
inline int get_min(int l, int r) {
  int d = Lg[r - l + 1];
  return RMQ_min(ST[d][l], ST[d][r - (1 << d) + 1]);
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", A + i), A[i + N] = A[i];
  N <<= 1;
  for (int i = 1; i <= N; ++i) ST[0][i] = i, Lg[i] = Lg[i >> 1] + 1;
  for (int i = 1; 1 << i <= N; ++i)
    for (int j = 1; j + (1 << i) - 1 <= N; ++j)
      ST[i][j] = RMQ_min(ST[i - 1][j], ST[i - 1][j + (1 << i - 1)]);
  for (int i = 2; i <= N; ++i) Fa[0][i] = get_min(std::max(1, i - A[i]), i - 1);
  for (int i = 1; 1 << i <= N; ++i)
    for (int j = 1; j <= N; ++j) Fa[i][j] = Fa[i - 1][Fa[i - 1][j]];
  N >>= 1;
  long long ans = 0;
  for (int i = N + N; i > N; --i) {
    if (A[i] >= N - 1) {
      ++ans;
      continue;
    }
    int cur = i, res = 0;
    for (int j = Lg[N]; ~j; --j)
      if (Fa[j][cur] - A[Fa[j][cur]] > i - N + 1)
        cur = Fa[j][cur], res += 1 << j;
    ans += res + 2;
  }
  std::cout << ans;
  return 0;
}
