В любом слове, введенном с клавиатуры определить кол-во букв — QBasic(Бейсик)

DECLARE FUNCTION CountOfA(s$)
word1$ = ""
word2$ = ""
word3$ = ""
INPUT "Type first word"; word1$
INPUT "Type second word"; word2$
INPUT "Type third word"; word3$
PRINT CountOfA(word1$)
PRINT CountOfA(word2$)
PRINT CountOfA(word3$)
FUNCTION CountOfA(s$)
    CountOfA = 0
    FOR i = 1 to Len(s$)
        IF UCASE$(MID$(s$, i, 1)) = "A" THEN CountOfA = CountOfA + 1
    NEXT
END FUNCTION