#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll getMult(ll n) {
  ll mult = 1;
  while (n >= 10) {
    mult *= 10;
    n /= 10;
  }
  return mult;
}
int main() {
  ll n;
  cin >> n;
  const auto m = getMult(n);
  cout << ((n / m + 1) * m) - n;
  return 0;
}
