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