#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3fLL;
int main() {
  int n;
  scanf("%d", &n);
  if (n < 10)
    puts("1");
  else {
    int aux = n;
    while (aux >= 10) {
      aux /= 10;
    }
    int num = aux + 1;
    aux = n;
    while (aux >= 10) {
      aux /= 10;
      num *= 10;
    }
    printf("%d\n", num - n);
  }
  return 0;
}
