#include <bits/stdc++.h>
using namespace std;
long long num[100005];
int main() {
  long long x, y, n, m, testCase, d, last;
  cin >> n;
  y = n;
  x = 1;
  while (n) {
    if (n < 10) {
      last = n + 1;
      break;
    }
    n /= 10;
    x *= 10;
  }
  x *= last;
  cout << x - y;
  return 0;
}
