diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -2,7 +2,7 @@
 H = list(map(int, input().split()))
 cnt = 0
 for i in range(len(H)):
-    if M - H[i] <= 0:
+    if M - H[i] < 0:
         break
     M = M - H[i]
     cnt += 1
