#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int arr[N];
bool vis[N];
int cnt[N];
int main() {
  int n;
  cin >> n;
  set<int> se;
  for (int i = 1; i <= n; i++) se.insert(i);
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
    se.erase(arr[i]);
  }
  cout << se.size() << endl;
  for (int i = 1; i <= n; i++) {
    if (cnt[arr[i]] <= 1) continue;
    int x = (*se.begin());
    if (vis[arr[i]]) {
      cnt[arr[i]]--;
      arr[i] = x;
      se.erase(se.begin());
    } else {
      if (x < arr[i]) {
        cnt[arr[i]]--;
        arr[i] = x;
        se.erase(se.begin());
      } else {
        vis[arr[i]] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << arr[i] << " ";
  return 0;
}
