#include <bits/stdc++.h>
using namespace std;
int x, tree[2000001], sz, i, n, q[2000001], an[2000001];
struct Pair {
  int x;
  int p;
} a[2000001];
bool cmp(Pair q, Pair w) { return q.x < w.x; }
void update(int x) {
  x /= 2;
  while (x > 0) {
    tree[x] = max(tree[x * 2], tree[x * 2 + 1]);
    x /= 2;
  }
}
int f(int l, int r) {
  l += sz - 1;
  r += sz - 1;
  int ans = i;
  while (l <= r) {
    if (l % 2 == 1) ans = max(tree[l], ans);
    if (r % 2 == 0) ans = max(tree[r], ans);
    l = (l + 1) / 2;
    r = (r - 1) / 2;
  }
  return ans;
}
int main() {
  cin >> n;
  sz = 1 << (int(log2(n - 1)) + 1);
  for (i = 1; i <= n; i++) {
    cin >> a[i].x;
    a[i].p = i;
  }
  sort(a + 1, a + n + 1, cmp);
  a[0].x = 2147483647;
  for (i = 1; i <= n; i++) {
    if (a[i].x != a[i - 1].x) x++;
    q[a[i].p] = x;
  }
  for (i = n; i >= 1; i--) {
    tree[q[i] + sz - 1] = max(i, tree[q[i] + sz - 1]);
    update(q[i] + sz - 1);
    an[i] = f(1, q[i] - 1) - i - 1;
  }
  for (i = 1; i <= n; i++) cout << an[i] << " ";
  return 0;
}
