#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, temp;
  int count = 0;
  scanf("%lld", &n);
  temp = n;
  while (temp) {
    temp /= 10;
    count++;
  }
  temp = pow(10, count - 1);
  long long ans = temp - (n % temp);
  printf("%lld\n", ans);
  return 0;
}
