import math


def repeatedString(s, n):
    """
    Returns the number of 'a's in the first n letters of a string consisting of
    infinitely repeating strings, s.
    """

    count = 0
    s_count_a = s.count('a')

    count += math.floor(n / len(s)) * s_count_a
    for _ in range(n % len(s)):
        if s[_] == 'a':
            count += 1

    return count