r count characters in string