XXXX Brewery interview question

Count the letters in strings without using inbuilt function