#include <bits/stdc++.h>
using namespace std;
long long a;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> a;
  for (long long i = 1; i < 1000000000000000007LL; i *= 10) {
    for (long long j = i; j <= 9 * i; j += i) {
      cerr << j << '\n';
      if (j > a) {
        cout << j - a;
        return 0;
      }
    }
  }
}
