count characters in text python