import java.util.*;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    }
} import java.util.*; util.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc int [] result = new int[3]; result new int[3] 3 for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        } int i = 0 ; int i = 0 ; i 0 i<3 i 3 i++ i++ i {
            result[i] = Integer.parseInt(input.substring(i,i+1));
        } {
            result[i] = Integer.parseInt(input.substring(i,i+1));
        } result[i] = Integer.parseInt(input.substring(i,i+1)) result[i] result i Integer.parseInt(input.substring(i,i+1)) Integer.parseInt Integer input.substring(i,i+1) input.substring input i i+1 i 1 if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        } result[0]==result[1] && result[1]==result[2] result[0]==result[1] result[0] result 0 result[1] result 1 result[1]==result[2] result[1] result 1 result[2] result 2 {
            System.out.println(input);
        } System.out.println(input) System.out.println System.out System System.out input {
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        } if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            } result[0]>=result[1] && result[0]>=result[2] result[0]>=result[1] result[0] result 0 result[1] result 1 result[0]>=result[2] result[0] result 0 result[2] result 2 {
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            } System.out.print(result[0]) System.out.print System.out System System.out result[0] result 0 System.out.print(result[0]) System.out.print System.out System System.out result[0] result 0 System.out.print(result[0]) System.out.print System.out System System.out result[0] result 0 if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            } result[1]>result[0] || result[0]==result[1] && result[0]<result[2] result[1]>result[0] result[1] result 1 result[0] result 0 result[0]==result[1] && result[0]<result[2] result[0]==result[1] result[0] result 0 result[1] result 1 result[0]<result[2] result[0] result 0 result[2] result 2 {
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            } System.out.print((result[0]+1)) System.out.print System.out System System.out (result[0]+1) result[0] result 0 1 System.out.print((result[0]+1)) System.out.print System.out System System.out (result[0]+1) result[0] result 0 1 System.out.print((result[0]+1)) System.out.print System.out System System.out (result[0]+1) result[0] result 0 1 String args[] args public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    }
} public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    }
} Main
import java.util.*;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String input = sc.next();
        
        int [] result = new int[3];
        
        for(int i = 0 ; i<3; i++){
            result[i] = Integer.parseInt(input.substring(i,i+1));
        }
        
    /*    for(int i = 0 ; i<3; i++){
            System.out.println(result[i]);
        }*/
        
        
        
        if(result[0]==result[1] && result[1]==result[2]){
            System.out.println(input);
        }
        else{
            if(result[0]>=result[1] && result[0]>=result[2]   ){
                System.out.print(result[0]);
                System.out.print(result[0]);
                System.out.print(result[0]);
            }
            else if(result[1]>result[0] || result[0]==result[1] && result[0]<result[2]){
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
                System.out.print((result[0]+1));
            }
        }
        
    }
}