#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long long MOD = 1e9 + 7;
const long long OO = 1e10;
const int N = 200002;
int f[N], a[N];
bool in[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    f[a[i]]++;
  }
  vector<int> v;
  for (int i = 1; i <= n; ++i)
    if (!f[i]) v.push_back(i);
  int nxt = 0;
  for (int i = 0; i < n; ++i) {
    if (f[a[i]] > 1) {
      if (in[a[i]]) {
        f[a[i]]--;
        a[i] = v[nxt++];
      } else {
        if (a[i] < v[nxt])
          in[a[i]] = 1;
        else {
          f[a[i]]--;
          a[i] = v[nxt++];
        }
      }
    }
    in[a[i]] = 1;
  }
  cout << v.size() << endl;
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
}
