#include <bits/stdc++.h>
int main() {
  long long int n;
  while (scanf("%lld", &n) == 1) {
    long long int m = 1, o = n;
    if (n < 10)
      printf("1\n");
    else {
      while (n / 10) {
        n = n / 10;
        m = m * 10;
      }
      if (n == 9)
        printf("%lld\n", (m * 10) - o);
      else
        printf("%lld\n", (m * (n + 1) - o));
    }
  }
  return 0;
}
