import Data.List
markerLength = 4
main = interact $
show
. (+ 1) . head
. (\l -> filter (\i -> markerLength == length (nub $ map (l !!) [i - (markerLength - 1) .. i])) [(markerLength - 1)..])