#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A, B, C;
  C = 1;
  cin >> A;
  B = A;
  while (B >= 10) {
    B /= 10;
    C *= 10;
  }
  C *= (B + 1);
  printf("%lld\n", C - A);
  return 0;
}
