#include <bits/stdc++.h>
using namespace std;
const int mac = 2e5 + 10;
int a[mac], q[mac], bug[mac], v[mac];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    q[a[i]]++;
  }
  int num = 0;
  for (int i = 1; i <= n; i++) {
    if (!q[i]) bug[++num] = i;
  }
  int nb = 1, ans = 0;
  for (int i = 1; i <= n; i++) {
    if (q[a[i]] > 1) {
      if (v[a[i]] == 0 && a[i] <= bug[nb]) {
        v[a[i]] = 1;
        continue;
      }
      q[a[i]]--, a[i] = bug[nb++];
      ans++;
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("%d\n", a[n]);
  return 0;
}
