#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p = 1;
  for (int i = 0; i <= 9; i++) {
    for (int j = 1; j <= 9; j++)
      if (j * p > n) return cout << j * p - n << endl, 0;
    p *= 10;
  }
}
