#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long> vec;
  long long m = 1;
  for (int i = 1; i <= 9; i++) {
    m *= 10;
    for (int y = 1; y <= 9; y++) {
      vec.push_back(y * m);
    }
  }
  int n;
  cin >> n;
  if (n / 10 == 0)
    cout << 1 << endl;
  else
    cout << *(upper_bound((vec).begin(), (vec).end(), n)) - n << endl;
  return 0;
}
