#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, top;
vector<int> f[N];
int a[N], s[N];
void ins(int x) {
  f[x].clear();
  if (a[x] == a[x - 1]) f[x].push_back(1);
  for (auto i : f[x - 1])
    if (a[x - 2 * i - 1] == a[x]) f[x].push_back(i + 1);
}
int check(int x) {
  if (f[x].empty()) return 0;
  int d = f[x].front();
  return binary_search(f[x - d].begin(), f[x - d].end(), d) ? d : 0;
}
int suf[N], p[N], c[N];
void push(int x) {
  suf[x] = (f[x].empty() ? 0 : f[x].front());
  p[x] = p[x - 1];
  c[x] = c[x - 1];
  int tmp = x - p[x];
  if (!(tmp & 1) && binary_search(f[x].begin(), f[x].end(), tmp >>= 1))
    p[x] += tmp, c[x]++;
}
int query(int x) {
  int res = c[x], l = p[x];
  for (int i = x; suf[i] && l < i - suf[i]; i -= suf[i]) res++;
  return res;
}
int z;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    top++;
    scanf("%d", &a[top]);
    ins(top);
    int tmp;
    if ((tmp = check(top)))
      top -= 2 * tmp, z++;
    else
      push(top);
    printf("%d ", 2 * z + query(top));
  }
  return 0;
}
