#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n == 1000000000) {
    cout << 1000000000;
    return 0;
  }
  vector<long long int> v;
  for (long long int i = 1; i < 10; i++) {
    v.push_back(i);
  }
  long long int i = 10;
  while (i < 1000000000) {
    for (long long int j = 1; j <= 9; j++) {
      v.push_back(j * i);
    }
    i = i * 10;
  }
  v.push_back(1000000000);
  long long int k;
  for (k = 0; k < v.size(); k++) {
    if (v[k] > n) break;
  }
  cout << v[k] - n;
  return 0;
}
