#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  scanf("%lld", &n);
  for (long long int i = 1; i < 10000000000000; i *= 10) {
    if (n < i) {
      cout << (n / (i / 10) + 1) * (i / 10) - n << endl;
      return 0;
    }
  }
  return 0;
}
