#include <bits/stdc++.h>
using namespace std;
int func(int n) {
  int digit = 0;
  int tmp = n;
  while (tmp != 0) {
    tmp /= 10;
    digit++;
  }
  if (digit == 1) {
    return 1;
  } else {
    int order = pow(10, digit - 1);
    return (n / order + 1) * order - n;
  }
}
int main() {
  int n;
  cin >> n;
  cout << func(n) << endl;
  return 0;
}
