
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    }
}





 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = n / 100; a n / 100 n 100 int b = (n - a * 100) / 10; b (n - a * 100) / 10 (n - a * 100) n a * 100 a 100 10 int c = (n - a * 100 - b * 10); c (n - a * 100 - b * 10) n - a * 100 - b * 10 n a * 100 a 100 b * 10 b 10 if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        } a < b || a < c a < b a b a < c a c {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1)) System.out.println System.out System System.out (a + 1) * 100 + (a + 1) * 10 + (a + 1) (a + 1) * 100 + (a + 1) * 10 + (a + 1) (a + 1) * 100 (a + 1) a 1 100 (a + 1) * 10 (a + 1) a 1 10 (a + 1) a 1 {
            System.out.println(a * 100 + a * 10 + a);
        } System.out.println(a * 100 + a * 10 + a) System.out.println System.out System System.out a * 100 + a * 10 + a a * 100 + a * 10 + a a * 100 a 100 a * 10 a 10 a String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int a = n / 100;
        int b = (n - a * 100) / 10;
        int c = (n - a * 100 - b * 10);

        if (a < b || a < c) {
            System.out.println((a + 1) * 100 + (a + 1) * 10 + (a + 1));
        } else {
            System.out.println(a * 100 + a * 10 + a);
        }
    }
}






