#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  scanf("%lld", &n);
  long long r, m = n;
  long long cnt = 1;
  while (m != 0) {
    r = m % 10;
    m = m / 10;
    cnt = cnt * 10;
  }
  r++;
  cnt = cnt / 10;
  long long ans = r * cnt - n;
  printf("%lld\n", ans);
}
