#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int count = 0;
    int tmp = n;
    while (tmp != 0) {
      tmp = tmp / 10;
      count++;
    }
    if (n < 10)
      cout << "1" << endl;
    else {
      int res;
      int x;
      x = n / (pow(10.0, count - 1)) + 1;
      res = x * pow(10.0, count - 1) - n;
      cout << res << endl;
    }
  }
  return 0;
}
