#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n < 10) {
    cout << 1 << endl;
    return 0;
  }
  string s = to_string(n);
  s = s.substr(1);
  long long x = stoll(s);
  s = to_string(n);
  s[0] = '1';
  for (int i = 1; i < s.length(); i++) s[i] = '0';
  cout << stoll(s) - x << endl;
}
