#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int cpy = n, count = 0;
  while (cpy != 0) {
    count++;
    cpy /= 10;
  }
  long long int x = n / (pow(10, count - 1));
  x++;
  x = x * pow(10, count - 1);
  cout << x - n << endl;
}
