Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

arr = [i for i in arr if i % 2==0]

cnt=0

while len(arr)>0:
    
    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)

        arr=[x*3 for x in arr]
        arr[idx]//=6
        cnt+=1

#    elif any(x % 2 == 0 for x in arr):
    else:
        cnt+=len(arr)
        break

print(cnt)




Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

arr = [i for i in arr if i % 2==0]

cnt=0

#1つでも偶数が存在する場合　trueでループ処理対象
#奇数は処理対象外にしてもよい

while len(arr)>0:
    
    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)

        #奇数は計算しなくて良い計算するだけ無駄
        arr=[x*3 for x in arr]
        arr[idx]//=6
    
    elif any(x % 2 == 0 for x in arr):
    
        val=max(list(filter(lambda x : x%2 ==0, arr)))        
        idx=arr.index(val)
        
        #奇数は計算しなくて良い計算するだけ無駄
        arr=[x*3 for x in arr]
        arr.pop(idx)
    cnt+=1

print(cnt)

Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

arr = [i for i in arr if i % 2==0]

cnt=0

#1つでも偶数が存在する場合　trueでループ処理対象
#奇数は処理対象外にしてもよい

while len(arr)>0:
    
    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)

        #奇数は計算しなくて良い計算するだけ無駄
        arr=[x*3 for x in arr]
        arr[idx]//=6
    
    elif any(x % 2 == 0 for x in arr):
    
        val=max(list(filter(lambda x : x%2 ==0, arr)))        
        idx=arr.index(val)
        
        #奇数は計算しなくて良い計算するだけ無駄
        arr=[x*3 for x in arr]
        arr[idx]//=6

    arr = [i for i in arr if i % 2==0]
    cnt+=1

print(cnt)

Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

cnt=0

while any(x % 2 == 0 for x in arr):

    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)
        
        arr=[x*3 for x in arr]
        arr[idx]//=6
               
        cnt+=1
    
    elif any(x % 2 == 0 for x in arr):
    
        val=max(list(filter(lambda x : x%2 ==0, arr)))        
        idx=arr.index(val)
        
        arr=[x*3 for x in arr]
        arr[idx]//=6
        
        cnt+=1
    
print(cnt)      

Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

cnt=0
chkflg=True

while chkflg:

    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)
        
        arr=[x*3 for x in arr]
        arr[idx]//=6
               
        cnt+=1
    
    elif any(x % 2 == 0 for x in arr):
    
        val=max(list(filter(lambda x : x%2 ==0, arr)))        
        idx=arr.index(val)
        
        arr=[x*3 for x in arr]
        arr[idx]//=6
        
        cnt+=1
    
    else:
        chkflg=False
        
print(cnt)      



Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

cnt=0
chkflg=True

while chkflg:

    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)
        
        for i in range(n):
            
            if i==idx:
                arr[i]//=2                
            else:
                arr[i]*=3
        
        cnt+=1
    
    elif any(x % 2 == 0 for x in arr):
    
        val=max(list(filter(lambda x : x%2 ==0, arr)))        
        idx=arr.index(val)
        
        for i in range(n):
            
            if i==idx:
                arr[i]//=2                
            else:
                arr[i]*=3
        
        cnt+=1
    
    
    else:
        chkflg=False
        
print(cnt)      




Fixed submission:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)