#include <bits/stdc++.h>
using namespace std;
long long n, k, dem = 0, cur = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  k = n;
  while (k > 0) {
    k /= 10;
    dem++;
    cur *= 10;
  }
  cur /= 10;
  for (long long i = 1; i <= 11; i++) {
    if (i * cur > n) {
      cout << i * cur - n;
      return 0;
    }
  }
}
