#include <bits/stdc++.h>
using namespace std;
int pow(int a, int b) {
  if (!b) return 1;
  if (b % 2) return a * pow(a, b - 1);
  return pow(a * a, b / 2);
}
int main() {
  int n;
  scanf("%d\n", &n);
  int tmp = n;
  int res = 0;
  while (tmp >= 10) {
    tmp /= 10;
    res++;
  }
  int t = (tmp + 1) * pow(10, res);
  printf("%d\n", t - n);
}
