#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int lucky, temp = 1, i, j, luckyb;
  cin >> lucky;
  luckyb = lucky;
  for (i = 1; lucky / 10 != 0; i++) {
    lucky /= 10;
  }
  if (i == 1) {
    cout << "1" << endl;
  } else if (i != 1) {
    for (j = 1; j < i; j++) temp *= 10;
    temp *= (lucky + 1);
    temp -= luckyb;
    cout << temp << endl;
  }
  return 0;
}
