#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
vector<int> val;
int book[maxn];
int a[maxn];
int main() {
  int n, i, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    book[a[i]]++;
  }
  for (i = 1; i <= n; i++)
    if (book[i] == 0) val.push_back(i);
  int x;
  printf("%d\n", val.size());
  for (i = 1, j = 0; i <= n && j < val.size(); i++) {
    x = val[j];
    if (book[a[i]] == 1) continue;
    if (book[a[i]] == 0) {
      a[i] = x;
      j++;
      continue;
    }
    if (a[i] < x) {
      book[a[i]] = 0;
      continue;
    }
    if (a[i] > x) {
      book[a[i]]--;
      a[i] = x;
      j++;
    }
  }
  for (i = 1; i <= n; i++) {
    printf(i == n ? "%d\n" : "%d ", a[i]);
  }
}
