#include <bits/stdc++.h>
char year[10];
int main() {
  scanf("%s", year);
  int l = strlen(year) - 1;
  int num = 0, num2 = 0;
  for (int i = 0; i <= l; i++) {
    num = num * 10 + year[i] - '0';
  }
  for (int i = 1; i <= l; i++) num2 = num2 * 10 + year[i] - '0';
  int x = 1;
  for (int i = 1; i <= l; i++) x *= 10;
  printf("%d\n", x - num2);
  return 0;
}
