#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int nn = n;
  int cnt = 0;
  while (nn >= 10) {
    nn /= 10;
    cnt++;
  }
  nn++;
  while (cnt--) nn = nn * 10;
  cout << nn - n << endl;
  return 0;
}
