import java.util.*;
public class Main{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     }
} import java.util.*; util.* java public class Main{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     }
} Main public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc String ans=""; ans "" int n1=n/100; n1 n/100 n 100 int n2=n%100; n2 n%100 n 100 if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        } n2>n1*10+n1 n2 n1*10+n1 n1*10 n1 10 n1 {
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        } System.out.println((n1+1)*100+(n1+1)*10+n1+1) System.out.println System.out System System.out (n1+1)*100+(n1+1)*10+n1+1 n1 (n1+1)*100+(n1+1)*10+n1+1 (n1+1)*100 (n1+1) n1 1 100 (n1+1)*10 (n1+1) n1 1 10 n1 1 {
            System.out.println(n1*100+n1*10+n1);
        } System.out.println(n1*100+n1*10+n1) System.out.println System.out System System.out n1*100+n1*10+n1 n1*100+n1*10+n1 n1*100 n1 100 n1*10 n1 10 n1 String []args args public class Main{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     }
} public class Main{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     }
} Main
import java.util.*;
public class Main{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String ans="";
        int n1=n/100;
        int n2=n%100;
        if(n2>n1*10+n1){
            System.out.println((n1+1)*100+(n1+1)*10+n1+1);    
        }else{
            System.out.println(n1*100+n1*10+n1);
        }
    
        
     }
}