#include <bits/stdc++.h>
using namespace std;
long long n, lol, cnt = 1, temp;
int main() {
  cin >> n;
  lol = n;
  while (lol / 10 > 0) {
    lol /= 10;
    cnt *= 10;
  }
  if (cnt == 1) {
    cout << 1 << endl;
  } else {
    temp = n / cnt + 1;
    temp = temp * cnt - n;
    cout << temp << endl;
  }
  return 0;
}
