How do I change this code to work from the serial monitor instead of a keypad?

It’s a door locking program.
I want to eliminate the keypad.

#include <Password.h> 
#include <Keypad.h> 
#include <Servo.h> 

Servo servoA;
Password password = Password( "1234" );

const byte ROWS = 4; // Four rows
const byte COLS = 3; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
 {'1','2','3'},
 {'4','5','6'},
 {'7','8','9'},
 {'*','0','#'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 5, 6, 7, 8 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { 2, 3, 4 };


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

const int BLED=9;    
const int GLED=12;   
const int RLED=11; 
int position = 0;

void setup(){

 Serial.begin(9600);
 servoA.attach(10);
 pinMode (BLED, OUTPUT);   
 pinMode (GLED, OUTPUT);   
 pinMode (RLED, OUTPUT);  
 keypad.addEventListener(keypadEvent);
 servoA.write(position--);

 
}

enum servoState {STOP, SEEK1, SEEK2};
servoState state = SEEK2;

void loop(){
 keypad.getKey();
 
 if (state == SEEK1 and position < 220)
  {
    digitalWrite(GLED, HIGH);
    servoA.write(position++);
    delay(5);
    digitalWrite(GLED, LOW);
  }
  else if (state == SEEK2 and position > 3)
  {
    digitalWrite(BLED, HIGH);
    servoA.write(position--);
    delay(5);
    digitalWrite(BLED, LOW);
  }
  else if (position <= 3 or position >= 220)
  {
    state = STOP;
  }
}


void keypadEvent(KeypadEvent eKey){
 switch (keypad.getState()){
  case PRESSED:
    Serial.print("Pressed: ");
    Serial.println(eKey);
    switch (eKey){
     case '#': checkPassword(); 
     break;
     case '*': lockDoor(); 
     break;
     default: password.append(eKey);
  }
 }
 
}

void lockDoor()
{
  digitalWrite(BLED, HIGH);
  state = SEEK2;
  password.reset();
  delay (500);
  digitalWrite(BLED, LOW);
  if (state == SEEK1 and position < 220)
  {
    digitalWrite(GLED, HIGH);
    servoA.write(position++);
    delay(5);
    digitalWrite(GLED, LOW);
  }
  else if (state == SEEK2 and position > 3)
  {
    digitalWrite(BLED, HIGH);
    servoA.write(position--);
    delay(5);
    digitalWrite(BLED, LOW);
  }
  else if (position <= 3 or position >= 220)
  {
    state = STOP;
  }
}

void checkPassword()
{
 if (password.evaluate())
 {
  Serial.println("Success");
  state = SEEK1;
  password.reset();
 }
 else
 {
  Serial.println("Wrong");
 digitalWrite(RLED, HIGH);
 delay(1000);
 digitalWrite(RLED, LOW);
 password.reset();
 }
 
 
 

}

See Serial input basics