#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int solve(long long n) {
  while (n > 9) {
    n = n / 10;
  }
  return n;
}
int main() {
  long long n;
  cin >> n;
  if (n <= 9)
    cout << 1 << endl;
  else {
    long long cnt_digits = log10(n);
    long long num = (solve(n) + 1) * pow(10, cnt_digits);
    cout << (num - n) << endl;
  }
}
