#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n];
  int hash[n + 1];
  memset(hash, 0, sizeof(hash));
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    hash[ar[i]]++;
  }
  int ans = 0;
  vector<int> vp;
  for (int i = 1; i <= n; i++) {
    if (hash[i] == 0) {
      ans++;
      vp.push_back(i);
    }
  }
  int visited[n + 1];
  memset(visited, 0, sizeof(visited));
  int l = vp.size();
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (hash[ar[i]] == 1) continue;
    if ((j < l) && (vp[j] > ar[i])) {
      if (visited[ar[i]] == 1) {
        hash[ar[i]]--;
        ar[i] = vp[j];
        j++;
      } else
        visited[ar[i]] = 1;
    } else if (j < l) {
      hash[ar[i]]--;
      ar[i] = vp[j];
      j++;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n; i++) cout << ar[i] << " ";
}
