Reading a numerical string from serial monitor to perform an action?

You might want to look at Serial.ReadBytesUntil().

And then atoi().