get longest strok from input.