task16
def count_matching_words(sentence):
    words = sentence.split()
    count = sum(1 for word in words if word[0] == word[-1])
    return count

sentence = "АРКА АННА АСТРА РЕЙС СТРАСС"
print(count_matching_words(sentence))
