There were 18 (Unix) or 21 (DOS) characters reported in the size of the file. Fifteen of those characters are shown as the alphabetic letters. The remaining 3 or 6 characters are the line feed (Unix) or carriage return and line feed (DOS) characters at the end of the lines. There was no additional end-of-file character accounted for in the file size.
When input is supplied from a file, the operating system knows the number of characters in the file. When all characters have been read, the end of the file has been reached. But when reading input from the console, the operating system isn't clairvoyant--it doesn't know how many characters the user is going to type. The user needs to end console input with Ctrl+Z or Ctrl+D to indicate end of input.