#include <bits/stdc++.h>
int main() {
  int n, base = 1;
  scanf("%d", &n);
  int tmp = n;
  while (tmp / 10) {
    base *= 10;
    tmp /= 10;
  }
  int next = (n / base + 1) * base;
  printf("%d\n", next - n);
  return 0;
}
