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