#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000;
const int MAXLOG = 19;
const int INF = 0x3f3f3f3f;
template <class T>
void Read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = 0;
  while (c < '0' || '9' < c) {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (flag) x = -x;
}
int n, m, maxlog;
int r[MAXN + 10], x[MAXN + 10];
int mnval[MAXN + 10][MAXLOG + 5], mlog2[MAXN + 10];
inline int minbyx(int a, int b) { return x[a] <= x[b] ? a : b; }
inline void init_mn() {
  for (int i = 1; i <= n; ++i) x[i] = max(1, i - r[i]);
  for (int i = 1; i <= n; ++i) mnval[i][0] = i - 1;
  for (int len = 1; len <= maxlog; ++len)
    for (int i = (1 << len) + 1; i <= n; ++i)
      mnval[i][len] =
          minbyx(mnval[i - (1 << (len - 1))][len - 1], mnval[i][len - 1]);
  for (int i = 1, j = 0; i <= n; ++i, (1 << (j + 1)) <= i ? ++j : 0)
    mlog2[i] = j;
}
inline int getmn(int l, int r) {
  int t = mlog2[r - l];
  return minbyx(mnval[l + (1 << t)][t], mnval[r][t]);
}
int fa[MAXN + 10], dp[MAXN + 10][MAXLOG + 5];
inline void init_jump() {
  for (int i = 1; i <= n; ++i) dp[i][0] = fa[i];
  for (int len = 1; len <= maxlog; ++len)
    for (int i = 1; i <= n; ++i) dp[i][len] = dp[dp[i][len - 1]][len - 1];
}
inline int getmndist(int p) {
  int ret = 0;
  int now = m + p - 1;
  for (int len = maxlog; len >= 0; --len)
    if (x[dp[now][len]] > p) ret += (1 << len), now = dp[now][len];
  if (x[now] <= p)
    return ret + 1;
  else
    return ret + 2;
}
int main() {
  Read(n), maxlog = log(n) / log(2) + 1;
  for (int i = 1; i <= n; ++i) Read(r[i]), r[n + i] = r[i];
  m = n, n <<= 1;
  init_mn();
  fa[1] = 0;
  for (int i = 2; i <= n; ++i) fa[i] = getmn(x[i], i);
  init_jump();
  long long int ans = 0;
  for (int i = 1; i <= m; ++i) ans += getmndist(i);
  printf("%I64d\n", ans);
}
