#include <bits/stdc++.h>
using namespace std;
long long a, b, c, i;
char e;
string p;
int main() {
  cin >> a;
  c = 1;
  i = a;
  while (a != 0) {
    a /= 10;
    b++;
    c *= 10;
  }
  c = c / 10;
  cout << (i / c + 1) * c - i;
}
