import Data.List
import Data.List.Split

main :: IO ()
main = do
  input <- readFile "input"
  print $ day6 4 input
  print $ day6 14 input

day6 :: Int -> String -> Int
day6 n = (+ n) . head . elemIndices n . map (length . nub . sort) . divvy n 1
