read_input() returns the length and respond() creates a copy of input to avoid modify the original string.