#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  while (tests--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    vector<int> freq(n + 1, 0);
    for (long long i = 0; i < n; i++) {
      freq[v[i]]++;
    }
    vector<int> pu;
    for (long long i = 1; i < n + 1; i++) {
      if (freq[i] == 0) pu.push_back(i);
    }
    int k = 0;
    cout << pu.size() << '\n';
    vector<int> flag(n + 1, 0);
    for (long long i = 0; i < n; i++) {
      if (freq[v[i]] > 1 || flag[v[i]] == 1) {
        if (v[i] > pu[k] || flag[v[i]] == 1) {
          freq[v[i]]--;
          v[i] = pu[k];
          k++;
        } else {
          flag[v[i]] = 1;
          freq[v[i]]--;
        }
      }
    }
    for (long long i = 0; i < n; i++) cout << v[i] << " ";
  }
}
