#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const long long MAXN = 1000001;
const long long MAXVAL = 5000000;
const long long INF = (long long)1e17 + 100;
const long long MOD = (long long)1e9 + 7;
string failMessage;
void fail() {
  cout << failMessage;
  exit(0);
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void solve() {
  int n, res;
  cin >> n;
  res = n;
  vector<int> a(n + 1);
  vector<int> perm;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    a[q]++;
    perm.push_back(q);
  }
  vector<int> next;
  for (int i = 1; i <= n; i++) {
    if (a[i] > 0) {
      res -= 1;
    } else {
      next.push_back(i);
    }
  }
  int l = 0;
  int ans = res;
  vector<int> vst(n);
  for (int i = 0; i < n; i++) {
    if (res != 0) {
      if (a[perm[i]] > 1) {
        if (perm[i] < next[l] && vst[perm[i]] == 0) {
          vst[perm[i]]++;
          continue;
        }
        a[perm[i]]--;
        perm[i] = next[l];
        l++;
        res--;
      }
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n; i++) {
    cout << perm[i] << " ";
  }
}
int main() {
  const string FILENAME = "input";
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
  solve();
}
