#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> mp1, mp2;
map<long long int, long long int> vis;
map<long long int, long long int> pos;
map<long long int, long long int> vis_s;
map<pair<long long int, long long int>, long long int> vis12;
priority_queue<long long int> pq;
priority_queue<long long int> pq2;
vector<long long int> vec;
vector<long long int> vec_s;
queue<long long int> vec1;
long long int ara[1000006], ara2[1000006];
void seive() {
  for (long long int i = 2; i * i <= 1000000; i++) {
    if (vis_s[i] == 0) {
      for (long long int j = i * i; j <= 1000000; j += i) vis_s[j] = 1;
    }
  }
  for (long long int i = 1; i <= 1000000; i++) {
    if (vis_s[i] == 0) vec_s.push_back(i);
  }
}
void save() {
  long long int sum = 1, m = 1;
  for (long long int i = 1;; i++) {
    m *= 2;
    sum += m;
    vec.push_back(sum);
    if (sum > 1000000000) {
      break;
    }
  }
}
int main() {
  long long int n, item, no;
  scanf("%lld", &no);
  long long int no1 = no;
  if (no <= 9)
    cout << "1" << endl;
  else {
    long long int m = 1;
    while (no > 9) {
      no /= 10;
      m *= 10;
    }
    m = m * (no + 1) - no1;
    cout << m << endl;
  }
  return 0;
}
