#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, temp, max;
  scanf("%llu", &n);
  int ct = 0;
  temp = n;
  while (temp != 0) {
    temp /= 10;
    ct++;
  }
  ct--;
  max = pow(10, ct);
  printf("%llu", (max - (n % max)));
  return 0;
}
