def count_consecutives(tosses):
    """
    Counts the number of consecutive heads or tails.
    """
    consecutive_tosses = 1
    max_consecutive_tosses = 1
    for i in range(0, len(tosses) - 1):
        if tosses[i] == tosses[i + 1]:
            consecutive_tosses += 1
            max_consecutive_tosses = max(max_consecutive_tosses, consecutive_tosses)
        else:
            consecutive_tosses = 1
    return max_consecutive_tosses