#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 205;
const int maxm = 200010;
set<int> s;
int a[maxm], vis[maxm], num[maxm];
int main() {
  int n;
  scanf("%d", &n);
  memset(num, 0, sizeof(num));
  memset(a, 0, sizeof(a));
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    num[a[i]]++;
  }
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    if (num[i] == 0) q.push(i);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (num[a[i]] > 1) {
      if (vis[a[i]] == 0 && a[i] < q.front())
        vis[a[i]] = 1;
      else {
        ans++;
        num[a[i]]--;
        a[i] = q.front();
        q.pop();
      }
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i < n; i++) printf("%d ", a[i]);
  printf("%d\n", a[n]);
  return 0;
}
