diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -12,7 +12,7 @@
     count = 0
     for i in range(N):
         now_time = (X[i] + j) % 24
-        if (now_time >= 9) and (now_time <= 18):
+        if (now_time >= 9) and (now_time < 18):
             count += W[i]
     max_count = max(max_count, count)
 print(max_count)
