#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005], check[200005], c[200005];
int main() {
  int n, i, j, k = 0, ans = 0, p;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  for (i = 1; i <= n; i++)
    if (b[i] == 0) {
      c[k++] = i;
      ans++;
    }
  k = 0;
  for (i = 0; i < n; i++) {
    if (b[a[i]] > 1) {
      if (c[k] > a[i] && check[a[i]] == 0)
        p = 5;
      else {
        b[a[i]]--;
        a[i] = c[k];
        k++;
      }
    }
    check[a[i]]++;
  }
  cout << ans << endl;
  for (i = 0; i < n; i++) cout << a[i] << ' ';
  return 0;
}
