read in dynamic size of input