#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a;
  cin >> n;
  queue<int> q;
  vector<int> flag, kle;
  flag.resize(n + 5, 0);
  for (int i = 0; i < n; i++) {
    cin >> a;
    q.push(a);
    ++flag[a];
  }
  for (int i = 1; i <= n; i++) {
    if (flag[i] == 0) kle.push_back(i);
  }
  cout << kle.size() << endl;
  int l = 0;
  vector<bool> flagnow;
  flagnow.resize(n + 5, false);
  while (!q.empty()) {
    a = q.front();
    if (flag[a] > 1) {
      if (a > kle[l] or flagnow[a]) {
        --flag[a];
        a = kle[l];
        ++l;
      }
    }
    flagnow[a] = true;
    cout << a << " ";
    q.pop();
  }
  cout << endl;
  return 0;
}
