#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a;
  b = a;
  int j = 0;
  while (b > 0) {
    b = b / 10;
    j++;
  }
  int k = 1;
  if (a < 10) {
    cout << 1;
  } else {
    for (int i = 1; i < j; i++) {
      k = k * 10;
    }
    cout << k - (a % k);
  }
}
