为什么我的代码给出TypeError:TypeError:'int'对象没有属性'__getitem__'?

我正在Python上编写一个脚本,给您一个字符串,它将查找字符串中字母的数量,将其输入到列表中,然后将该列表加起来。我的脚本执行程序不断出现此错误:

Traceback (most recent call last):
File "Untitled.py", line 9, in <module>
countersplit = len(tosplit[counter])
TypeError: 'int' object has no attribute '__getitem__'

我的代码如下:

userin = raw_input("Enter sentence: ")
split = userin.split()
tosplit = len(split)
print(tosplit)
counter = 0
countersplit = 0
while counter < tosplit:
    countersplit = len(tosplit[counter])
    wordcount = [countersplit]
    print(wordcount)
    print(countersplit)
    counter = counter + 1

我该如何解决这个问题?