Module _20190422

    Sub Main()

        Dim sNextContest() As Char = Console.ReadLine().ToCharArray

        Dim iKuriagariFlg As Integer = 0

        For i As Integer = 1 To sNextContest.Length - 1

            If sNextContest(0) < sNextContest(i) Then

                iKuriagariFlg = 1

                Exit For

            End If

        Next

        If iKuriagariFlg = 0 Then

            Console.WriteLine(sNextContest(0) & sNextContest(0) & sNextContest(0))

        Else

            Dim A As String = (CInt(sNextContest(0).ToString) + 1).ToString

            Console.WriteLine(A & A & A)

        End If

    End Sub

End Module