import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    }
    static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    }
    static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    } main {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int num = stdIn.nextInt(); num stdIn.nextInt() stdIn.nextInt stdIn num = swap(num) num swap(num) swap num System.out.println(num) System.out.println System.out System System.out num String[] args args static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    } swap {
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    } int j j k k l; l j = num/100 j num/100 num 100 k = (num%100)/10 k (num%100)/10 (num%100) num 100 10 l = num%10 l num%10 num 10 if(j >= k && j >= l){
            return (j*100+j*10+j);
        } j >= k && j >= l j >= k j k j >= l j l {
            return (j*100+j*10+j);
        } return (j*100+j*10+j); (j*100+j*10+j) j*100+j*10+j j*100 j 100 j*10 j 10 j if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        } j < k || j < l j < k j k j < l j l {
            return ((j+1)*100+(j+1)*10+(j+1));
        } return ((j+1)*100+(j+1)*10+(j+1)); ((j+1)*100+(j+1)*10+(j+1)) (j+1)*100+(j+1)*10+(j+1) (j+1)*100 (j+1) j 1 100 (j+1)*10 (j+1) j 1 10 (j+1) j 1 return (j*100+j*10+j); (j*100+j*10+j) j*100+j*10+j j*100 j 100 j*10 j 10 j int num num public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    }
    static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    }
} public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    }
    static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int num = stdIn.nextInt();
        num = swap(num);
        System.out.println(num);
    }
    static int swap(int num){
        int j,k,l;
        j = num/100;
        k = (num%100)/10;
        l = num%10;
        if(j >= k && j >= l){
            return (j*100+j*10+j);
        }
        if(j < k || j < l){
            return ((j+1)*100+(j+1)*10+(j+1));
        }
        return (j*100+j*10+j);
    }
}