It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.

Now you are suggested to solve the following problem: given a year number, find the minimum year number which is strictly larger than the given one and has only distinct digits.
The single line contains integer *y* (1000 ≤ *y* ≤ 9000) — the year number.
# Input the number of friends and the fence height
n, h = map(int, input().split())

# Input the heights of friends as a list
heights = list(map(int, input().split()))

# Initialize the minimum width of the road
width = 0

# Iterate through the heights and calculate the width
for height in heights:
    if height > h:
        width += 2  # If the friend's height is greater than h, they need a width of 2
    else:
        width += 1  # Otherwise, they need a width of 1

# Print the minimum width of the road
print(width)
