#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int count = 0;
  long long int rem;
  long long int temp = n;
  while (n > 0) {
    rem = n % 10;
    n = n / 10;
    count++;
  }
  rem += 1;
  for (int i = 1; i < count; i++) {
    rem *= 10;
  }
  cout << rem - temp << '\n';
}
int main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
