diff --git a/src/winio.c b/src/winio.c
index 9ba9799fe46876f8c4e8edef8eba3f8c8eb32e63..4d3460d2c4cde2825378d4e832692254b896f719 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -346,19 +346,10 @@ int parse_kbinput(WINDOW *win)
 	case NANO_CONTROL_3:
 	    /* Increment the escape counter. */
 	    escapes++;
-	    switch (escapes) {
-		case 1:
-		    /* One escape: wait for more input. */
-		case 2:
-		    /* Two escapes: wait for more input. */
-		case 3:
-		    /* Three escapes: wait for more input. */
-		    break;
-		default:
-		    /* More than three escapes: limit the escape counter
-		     * to no more than two, and wait for more input. */
-		    escapes %= 3;
-	    }
+	    /* If there are four consecutive escapes, discard three of them. */
+	    if (escapes > 3)
+		escapes = 1;
+	    /* Wait for more input. */
 	    break;
 	default:
 	    switch (escapes) {