serial read echo and servo

What have you tried? Doing what you want is trivial. There are dozens of examples posted every data for reading serial data and storing it in an array. There are daily examples for parsing that data. There are daily examples of converting a string to an int.

Which of them have you failed to find? Which did you fail to find because you failed to look?