diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -2,7 +2,7 @@
 
 N, S, M, L = map(int, input().split())
 ans = 10**20
-for i, j, k in product(range(N), repeat=3):
+for i, j, k in product(range(N + 1), repeat=3):
     if 6 * i + 8 * j + 12 * k < N:
         continue
     ans = min(ans, S * i + M * j + L * k)
