#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    int ans = (n + 110) / 111 * 111;
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size() - 8; i++) {
    cout << s.at(i);
  }
  cout << endl;
}

    