#include <bits/stdc++.h>
int main() {
  int n, i, c, dig = 0, y, k, p, s;
  scanf("%d", &n);
  s = n;
  while (n > 0) {
    n = n / 10;
    dig++;
  }
  if (dig == 1)
    y = 1;
  else {
    k = round(pow(10, dig - 1));
    p = s / k;
    c = (k * (p + 1));
    y = c - s;
  }
  printf("%d\n", y);
  return 0;
}
