SUPW : whats wrong with my code

whats wrong with my code: why its not accepted? for SUPW problem

import numpy as np
N=int(input())
l=list(map(int,input().split()))[:N]
arr=np.array(l)
b=0
x=N%3
y=N-x
j=0
if(N>2):
for i in range(0,y,3):
a=arr[i:i+3]
b=b+min(a)
if(i==y-3):
j=i+3
if(x==1 or x==2):
a = arr[j:j + x]
b = b + min(a)
print(b)