import java.util.*;

public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    }
} import java.util.*; util.* java public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    }
} Main long INF = Long.MAX_VALUE; INF Long.MAX_VALUE Long Long.MAX_VALUE public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    } solve {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans=N/100; ans N/100 N 100 int A=ans*100+ans*10+ans; A ans*100+ans*10+ans ans*100+ans*10+ans ans*100 ans 100 ans*10 ans 10 ans if(A>=N){
            ans=ans;
        }else{
            ans++;
        } A>=N A N {
            ans=ans;
        } ans=ans ans ans {
            ans++;
        } ans++ ans for(int i=0;i<3;i++){
            System.out.print(ans);
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            System.out.print(ans);
        } {
            System.out.print(ans);
        } System.out.print(ans) System.out.print System.out System System.out ans System.out.println() System.out.println System.out System System.out public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    }
} public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    }
} Main
import java.util.*;

public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans=N/100;
        int A=ans*100+ans*10+ans;
        if(A>=N){
            ans=ans;
        }else{
            ans++;
        }
        for(int i=0;i<3;i++){
            System.out.print(ans);
        }
        System.out.println();
    }
}