You are given a string s containing lower-case letters of Latin alphabet. We define a distance between two symbols s_i, s_j of this string as difference between their positions, i.e. |j - i|. Let us consider all pairs of equal symbols located in different positions, and calculate distances between symbols of each pair.
Write the program for determining minimum of all such distances.
The single line of input file contains a string s. The length of this string does not exceed 5·10^6.
Output one number, minimal distance between equal symbols. If there are no pairs of equal symbols in the string, output the number 0.