The input string can have spaces which are skipped, so you can't assume anything from the input string length, can you?