#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  while (cin >> n) {
    long long int bs = 1;
    long long int t = n;
    while (t != 0) {
      t /= 10;
      bs *= 10;
    }
    bs /= 10;
    t = (n / bs + 1) * bs;
    cout << t - n << endl;
  }
  return 0;
}
