Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters.