Andrey's submission of Counting Strings | CodeChef