CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))
ans = 1
A = [int(i) for i in input().split()]
for a in A:
  ans *= a
if ans > 10**18:
  print((-1))
else:
  print(ans)

# Optimized solution
N = int(eval(input()))
ans = 1
A = [int(i) for i in input().split()]
if 0 in A:
  print((0))
  exit()
for a in A:
  ans *= a
  if ans > 10**18:
    print((-1))
    exit()
print(ans)
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
ans=1
for i in a:
	ans*=i
if ans>10**18:
	print('-1')
else:
	print(ans)

# Optimized solution
n=int(eval(input()))
a=sorted(map(int,input().split()))
ans=1
for i in a:
	ans*=i
	if ans==0:
		break
	elif ans>10**18:
		print('-1')
		exit()
print(ans)
# Original solution
from functools import reduce
N = int(eval(input()))
mul = reduce(lambda x,y: x*y, list(map(int, input().split())))
res = mul if mul <= 10 ** 18 else -1
print(res)

# Optimized solution
from functools import reduce
N = int(eval(input()))
A = [*list(map(int, input().split()))]

if 0 in A:
    print((0))
    exit()

mul = 1
for n in A:
    mul *= n
    if mul > 10 ** 18:
        print((-1))
        exit()
print(mul)
# Original solution
n= int(eval(input()))
l =list(map(int,input().split()))
ans= 1
for i in range(n):
    ans*= l[i]
if ans <= 10**18:
    print(ans)
else:
    print("-1")

# Optimized solution
n= int(eval(input()))
l =list(map(int,input().split()))
ans= 1

if 0 in l:
    print("0")
else:
    for i in range(n):
        ans*= l[i]
        if ans> 10**18:
            break
    if ans> 10**18:
        print("-1")
    else:
        print(ans)
# Original solution
N = int(eval(input()))
A=list(map(int, input().split()))
ans=1
for i in range(N):
    ans=ans*A[i]
if ans>10**18:
    print((-1))
else:
    print(ans)

# Optimized solution
N = int(eval(input()))
A=list(map(int, input().split()))
ans=1
if 0 in A:
    ans=0
    print(ans)
else:
    for i in range(N):
        if ans>10**18:
            break
        ans=ans*A[i]
    if ans>10**18:
        print((-1))
    else:
        print(ans)
# Original solution
import math

N = int(eval(input()))
A = [int(Ai) for Ai in input().split()]

product = math.prod(A)
if product <= 10 ** 18:
    print(product)
else:
    print((-1))


# Optimized solution
N = int(eval(input()))
A = [int(Ai) for Ai in input().split()]

if 0 in A:
    print((0))
else:
    product = 1
    for Ai in A:
        product *= Ai
        if product > 10 ** 18:
            print((-1))
            exit()

    print(product)
# Original solution
def main ():
  N = int(eval(input()))
  A = list(map(int,input().split()))
  prod = 1 
  
  for a in A:
    prod *= a
    
  if prod > 1000000000000000000:
    print((-1))
    return
  
  else:
    print(prod) 

main()

# Optimized solution
def main ():
  N = int(eval(input()))
  A = list(map(int,input().split()))
  prod = 1 
  A.sort()
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print((-1))
      return
  
  print(prod) 
 
main()
# Original solution
N = int(eval(input()))

A = list(map(int, input().split()))

ans = 1
for a in A:
    ans *= a

if ans > 10**18:
    ans = -1

print(ans)

# Optimized solution
N = int(eval(input()))

A = list(map(int, input().split()))

if 0 in A:
    print((0))
else:
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            print((-1))
            exit(0)
    print(ans)
# Original solution
###############################################################################
#Imports
import collections
import itertools
from functools import lru_cache
import sys
import math
###############################################################################
#Constants
MOD = int(1e9)+7
###############################################################################
#Helper
def helper():
	pass
###############################################################################
#Solver
def solve():
	n = int(eval(input()))
	arr = list(map(int, input().split(' ')))
	sm = 1
	for num in arr:
		sm *= num
	if sm > int(1e18):
		print((-1))
		return
	print(sm)

###############################################################################
#Driver
t = 1
for _ in range(t):
	solve()
###############################################################################


# Optimized solution
###############################################################################
#Imports
import collections
import itertools
from functools import lru_cache
import sys
import math
###############################################################################
#Constants
MOD = int(1e9)+7
###############################################################################
#Helper
def helper():
	pass
###############################################################################
#Solver
def solve():
	n = int(eval(input()))
	arr = list(map(int, input().split(' ')))
	sm = 1
	if 0 in arr:
		print((0))
		return
	for num in arr:
		sm *= num
		if sm > int(1e18):
			print((-1))
			return
	print(sm)

###############################################################################
#Driver
t = 1
for _ in range(t):
	solve()
###############################################################################
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 1
for i in range(N):
    ans = ans*A[i]

if ans > 10 ** 18:
    print((-1))
else:
    print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

A = sorted(A)
ans = 1
for i in range(N):
    ans = ans*A[i]
    if ans == 0:
        print(ans)
        exit()
    if ans > 10 ** 18:
        print((-1))
        exit()

print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
flag = 0
b = 1

for i in range(n):
  b *= a[i]

if b > 10**18:
  print((-1))
else:
  print(b)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
flag = 0
b = 1

if 0 in a:
  print((0))
else:
  for i in range(n):
    b *= a[i]
    if b > 10**18:
      flag = 1
      break
  if b > 10**18:
    print((-1))
  else:
    print(b)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
a=1
for i in range(N):
    a*=A[i]
if a>10**18:
    a=-1
print(a)

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
a=1
for i in A:
    if i==0:
        print((0))
        exit()
for i in range(N):
    a*=A[i]
    if a>10**18:
        print((-1))
        exit()
print(a)
# Original solution
from functools import reduce
import sys
input = sys.stdin.readline

count = int(eval(input()))
list = list(map(int, input().split()))
if 0 in list:
    print((0))
else:
    sum = reduce(lambda x, y: x*y, list)
    if sum > 1000000000000000000:
        sum = -1
    print(sum)

# Optimized solution
from functools import reduce
from operator import mul
import sys
input = sys.stdin.readline

count = int(eval(input()))
list = list(map(int, input().split()))
sum = list[0]
if 0 in list:
    print((0))
    exit()
else:
    for i in range(count - 1):
        sum = sum * list[i + 1]
        if sum > 1000000000000000000:
            print((-1))
            exit()


    print(sum)
# Original solution
import math
import sys
from decimal import *

n = int(eval(input()))
a = list(map(int, input().split()))

getcontext().prec = 21

aa = [Decimal(b).log10() for b in a if a != 0]

ans = Decimal('0')

for c in aa:
    ans += c


if ans > 18.0:
    print((-1))
else:
    ans = 1
    for c in a:
        ans *= c
    print(ans)


# Optimized solution
n = int(eval(input()))

a = list(map(int, input().split()))
a.sort()

ans = 1

for b in a:
    if b == 0:
        ans = 0
        break
    else:
        ans *= b
        if ans > pow(10, 18):
            ans = -1
            break

print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1

for i in range(n):
    if 0 in a:
        ans = 0
        break
    
    ans *= a[i]
    if ans > 10**18:
        ans = -1
        break

print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1

if 0 in a:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            ans = -1
            break

print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
if 0 in a:
	ans = 0
else:
	for i in a:
		ans *= i
if(ans>10**18):
	print((-1))
else:
	print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
if 0 in a:
	ans = 0
else:
	for i in range(n-1,-1,-1):
		ans *= a[i]
		if(ans>10**18):
			break
if(ans>10**18):
	print((-1))
else:
	print(ans)
# Original solution
from operator import mul
from functools import reduce

N = eval(input())
s = input().split()
k = [int(_) for _ in s] 
y = reduce(mul, k)

if y <= 10**18:
    print(y)
else:
    print((-1))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 1
if 0 in a:
  print((0))
else:
  for i in range(n):
    ans *= a[i]
    if ans > 10**18:
      print((-1))
      break
    if i == n-1:
      print(ans)
# Original solution
N = int(eval(input()))
nums = list(map(int, input().split()))

ans = 1
for num in nums:
    ans = ans * num

if ans > 10**18:
    print('-1')
else:
    print(ans)


# Optimized solution
N = int(eval(input()))
nums = sorted(map(int, input().split()))
if nums[0] == 0:
    print((0))
else:
    ans = 1
    for num in nums:
        ans = ans * num
        if ans > 10**18:
            break
    if ans > 10**18:
        print('-1')
    else:
        print(ans)
# Original solution
from typing import Iterable


def multply(nums: Iterable[int]) -> int:
    if 0 in nums:
        return 0

    result = 1

    for i in nums:
        result *= i
        if result > 10**18:
            return -1

    return result

count_num = int(eval(input()))
nums = list(map(int, input().split()))
print((multply(list(nums))))


# Optimized solution
from typing import Collection


def multply(nums: Collection[int]) -> int:
    if 0 in nums:
        return 0

    result = 1

    for i in nums:
        result *= i
        if result > 10**18:
            return -1

    return result

count_num = int(eval(input()))
nums = list(map(int, input().split()))
print((multply(list(nums))))
# Original solution
import collections

n = int(eval(input()))
A = list(map(int, input().split()))

if 0 in A:
  print((0))
  exit()

counter = collections.Counter(A)
ans = 1
for k, v in list(counter.items()):
  ans *= k ** v
if ans > 10**18:
  print((-1))
else:
  print(ans)

# Optimized solution
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 2
    A = [1000000000, 1000000000]

  else:
    ##INPUT 
    n = eval(input())
    A = list(map(int, input().split()))

  ## SUBMITION CODES HERE
  if 0 in A:
    print((0))
    exit()
  
  ans = 1
  for a in A:
    ans *= a
    if ans > 10**18:
      ans = -1
      break
  
  print(ans)
    
main()
# Original solution
if __name__ == '__main__':
    n = int(eval(input()))
    arr = list(map(int, input().split()))
    product = arr[0]
    for i in range(1, n):
        product *= arr[i]
    if product > (10**18):
        product = -1
    print(product)

# Optimized solution
if __name__ == '__main__':
    n = int(eval(input()))
    arr = list(map(int, input().split()))
    product = arr[0]
    if 0 in arr:
        product = 0
    else:
        for i in range(1, n):
            product *= arr[i]
            if product > (10**18):
                product = -1
                break
    print(product)
# Original solution
n=int(eval(input()))
array=list(map(int,input().split()))
ans=1
for i in range(n):
  ans=ans*array[i]
if ans>10**18:
  print((-1))
else:
  print(ans)

# Optimized solution
n=int(eval(input()))
array=list(map(int,input().split()))
ans=1
if 0 in array:
  ans=0
else:
  for i in range(n):
    if ans>10**18:
      break
    else:
      ans=ans*array[i]
if ans>10**18:
  print((-1))
else:
  print(ans)
# Original solution
from collections import deque
n = int(eval(input()))

a = deque(list(map(int,input().split())))
ans = 1
for i in range(n):
    ans = ans * a.popleft()



if(ans > 10**18):
    print("-1")
else:
    print(ans)

# Optimized solution
from collections import deque
import sys
n = int(eval(input()))

a = list(map(int,input().split()))
a.sort()
if(a[0] == 0):
    print("0")
    sys.exit()
ans = 1
for i in range(n):

    ans = ans * a[i]
    if(ans > 10**18):
        print("-1")
        sys.exit()
     




print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

ret = 1
for i in range(n):
	ret = ret*a[i]

if(ret > 10**18):
	print((-1))
else:
	print(ret)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 10**18

ret = 1
for i in range(n):
	if(ret <= MAX):
		ret = ret*a[i]
	if(a[i] == 0):
		ret = 0
		break


if(ret > MAX):
	print((-1))
else:
	print(ret)
# Original solution
n=int(eval(input()))
a=[int(x) for x in input().split()]
b=1
for i in range(n):
  b*=a[i]
if b>10**18:
  print((-1))
else:
  print(b)

# Optimized solution
n=int(eval(input()))
a=[int(x) for x in input().split()]
if 0 in a:
  print((0))
else:
  b=1
  for i in range(n):
    b*=a[i]
    if b>10**18:
      print((-1))
      exit()
  print(b)
# Original solution
n = int(input().strip())
L = list(map(int, input().strip().split()))
ans=1
for v in L:
    ans*=v

if ans>10**18:
    print((-1))
else:
    print(ans)

# Optimized solution
n = int(input().strip())
L = list(map(int, input().strip().split()))
L.sort(reverse=True)
if L[-1]==0:
    print((0))
    exit()
ans=1
for v in L:
    ans*=v
    if ans>10**18:
        print((-1))
        exit()

print(ans)
# Original solution
N = int(eval(input()))
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)
if total > 10**18:
  print((-1))
else:
  print(total)

# Optimized solution
N = int(eval(input()))
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)

  if total > 10**18:
    break
for i in MM:
  if int(i) == 0:
    total = 0
if total > 10**18:
  print((-1))
else:
  print(total)
# Original solution
def main():
    n = eval(input())
    A = [int(i) for i in input().split()]
    ans = 1
    for a in A:
        ans *= a

    if ans > pow(10, 18):
        print("-1")
    else:
        print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
def main():
    n = eval(input())
    A = [int(i) for i in input().split()]
    if 0 in A:
        print("0")
        return
    ans = 1
    max_num = pow(10, 18)
    for a in A:
        ans *= a
        if ans > max_num:
            print("-1")
            return
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
def solve() :
    n = int(eval(input())) 
    a = list(map(int, input().split()))

    total = 1

    for i in a :
        if i == 0 :
            print((0))
            return
        total *= i

    if total > 1000000000000000000 :
        print((-1))
        return

    print(total)

if __name__ == "__main__" :
    solve()

# Optimized solution
def solve() :
    n = int(eval(input())) 
    a = list(map(int, input().split()))

    total = 1

    if 0 in a :
        print((0))
        return

    for i in a :
        total *= i

        if total > 10 ** 18 :
            print((-1))
            return

    print(total)

if __name__ == "__main__" :
    solve()
# Original solution
def solve() :
    n = int(eval(input())) 
    a = list(map(int, input().split()))

    total = 1

    if 0 in a :
        print((0))
        return

    for i in a :
        total *= i

        if total > 10 ** 18 :
            print((-1))
            return

    print(total)

if __name__ == "__main__" :
    solve()

# Optimized solution
def solve() :
    n = list(map(int, input().split())) 
    a = list(map(int, input().split()))

    total = 1

    if 0 in a :
        print((0))
        return

    for i in a :
        total *= i

        if total > 10 ** 18 :
            print((-1))
            return

    print(total)

if __name__ == "__main__" :
    solve()
# Original solution
N =int(eval(input()))
L = list(map(int,input().split()))
A=1
for i in range(N):
    if 0 in L:
        print((0))
        break
    A = A * L[i]
    if i == N-1 and A <= 10**18:
        print(A)
    elif A > 10**18:
        break
if A > 10**18:
    print((-1))

# Optimized solution
N = int(eval(input()))
Alist = list(map(int,input().split()))
Answer = 1
if 0 in Alist:
    Answer = 0
for i in range(N):
    Answer *= Alist[i]
    if Answer > 10**18:
        Answer = -1
        break
print(Answer)
# Original solution

n = int(eval(input()))

a_list = list(map(int, input().split()))

if n != 0 :
    ans = a_list[0]
else :
    ans = 0

for i in range(1, n):
    ans = ans * a_list[i]

if 10**18 < ans :
        ans = -1   


print(ans)

# Optimized solution

n = int(eval(input()))

a_list = list(map(int, input().split()))

if n != 0 :
    ans = a_list[0]
else :
    ans = 0

if 0 in a_list :
    ans = 0

for i in range(1, n):
    ans = ans * a_list[i]

    if 10**18 < ans :
        ans = -1
        break

print(ans)
# Original solution
N = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for i in range(N):
  ans *= a[i]
  if ans > 10 ** 18 and 0 not in a:
    print((-1))
    break
else:
  print(ans)

# Optimized solution
N = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print((0))
else:
  for i in range(N):
    ans *= a[i]
    if ans > 10 ** 18:
      print((-1))
      break
  else:
    print(ans)
# Original solution
def main():
        N = int(eval(input()))
        A = list(map(int, input().split()))
        ans = 1

        for i in range(N):
                ans = ans*A[i]

        if ans>10**18:
                ans = -1

        return ans


if __name__=="__main__":
        ans = main()
        print(ans)

# Optimized solution
def main():
        N = int(eval(input()))
        A = list(map(int, input().split()))
        ans = 1

        if 0 in A:
                ans = 0
        else:
                for i in range(N):
                        ans = ans*A[i]
                        if ans>10**18:
                                ans = -1
                                break

        return ans


if __name__=="__main__":
        ans = main()
        print(ans)
# Original solution
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = 10 ** 18


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    answer = 1
    for i in range(N):
        answer *= A[i]

    if answer > INF:
        print((-1))
    else:
        print(answer)


if __name__ == "__main__":
    main()


# Optimized solution
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = 10 ** 18


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    if 0 in A:
        print((0))
        return

    answer = 1
    for i in range(N):
        answer *= A[i]
        if answer > INF:
            print((-1))
            return

    print(answer)


if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
lst = list(map(int, input().split()))
mult = 1

for i in lst:
    mult *= i

if mult > 10 ** 18:
    print((-1))
    exit()
else:
    print(mult)

# Optimized solution
n = int(eval(input()))
lst = sorted(list(map(int, input().split())))
mult = 1

for i in lst:
    mult *= i
    if 10**18 < mult:
        print((-1))
        exit()
else:
    print(mult)
# Original solution
# -*- coding: utf-8 -*-
n = int(eval(input()))
a = [int(i) for i in input().split()]

ans = 1
for i in range(n):
    ans *= a[i]
if ans > pow(10, 18):
    print((-1))
else:
    print(ans)


# Optimized solution
# -*- coding: utf-8 -*-
n = int(eval(input()))
a = [int(i) for i in input().split()]

ans = 1
a.sort()
for i in range(n):
    ans *= a[i]
    #print(ans)
    if ans > pow(10, 18):
        print((-1))
        exit()
print(ans)
# Original solution
from functools import reduce
N = int(eval(input()))
A = reduce(lambda x, y:x*y if x*y <= 10**18 else -1, list(map(int, input().split())))
print(A)


# Optimized solution
from math import log
from functools import reduce
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
if A[0] == 0:
  print((0))
else:
  ans = 1
  for a in reversed(A):
    ans *= a
    if ans > 10**18:
      ans = -1
      break
  print(ans)
# Original solution
import sys

def main():
    n = int(eval(input()))
    A = list(map(int, sys.stdin.readline().split()))

    ans = 1
    for i in range(n):
        ans *= A[i]

    if ans > 10 ** 18:
        print('-1')
    else:
        print(ans)


if __name__ == '__main__':
    main()

# Optimized solution
import sys

def main():
    n = int(eval(input()))
    A = list(map(int, sys.stdin.readline().split()))

    ans = 1

    if 0 in A:
        print((0))
        sys.exit()

    for i in range(n):
        ans *= A[i]
        if ans > 10 ** 18:
            print('-1')
            sys.exit()

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import functools
import operator
 
n = int(eval(input()))
ms = list(map(int, input().split()))
 
if 0 in ms:
  r = 0
else:
  r = functools.reduce(operator.mul, ms)
if r > 10 ** 18:
  r = -1
print(r)

# Optimized solution
n = int(eval(input()))
ms = list(map(int, input().split()))
iter_ms = iter(ms) 
r = 1
if 0 in ms:
  r = 0
else:
    for i in range(n):
        x = next(iter_ms)
        r *= x
        if r > 10 ** 18:
            r = -1
            break
        
print(r)
# Original solution
n = int(eval(input()))
s = list(map(int, input().split()))
ans = 1
for i in range(n):
    if s[i] == 0:
        print("0")
        exit()
    ans *= s[i]
if ans > 10**18:
        print("-1")
else: print(ans)

# Optimized solution
n = int(eval(input()))
s = list(map(int, input().split()))
ans = 1
if 0 in s:
    print("0")
    exit()
for i in range(n):
    ans *= s[i]
    if ans > 10**18:
        print("-1")
        exit()
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
for x in a:
	ans *= x
	
if ans > 10**18:
	print((-1))
else:
	print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
a.sort()
for x in a:
	ans *= x
	if x == 0:
		print((0))
		break
	elif ans > 10**18:
		print((-1))
		break
else:
	print(ans)
# Original solution
def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    max_ans = 10 ** 18
    ans = 0
    for i in A:
        if ans == 0:
            ans = i
        else:
            ans *= i

    if max_ans < ans:
        print((-1))
    else:
        print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    max_ans = 10 ** 18
    ans = 0
    if 0 in A:
        print((0))
        exit()

    for i, a in enumerate(A):
        if i == 0:
            ans = a
            continue

        ans = ans * a
        if ans > max_ans:
            print((-1))
            exit()

    if max_ans < ans:
        print((-1))
    else:
        print(ans)


if __name__ == '__main__':
    main()
# Original solution
from sys import stdin
N = int(stdin.readline().rstrip())
data = list(map(int,input().split()))

count =data[0]
data.remove(data[0])

if 0 in data:
    print((0))

else:

    for _ in data:

        if count ==0:
            break
        elif count <= 10**18:
            count *= _

    if count ==0:
        print((0))
    elif count <= 10**18:
        print(count)
    else:
        print((-1))

# Optimized solution
from sys import stdin
N = int(stdin.readline().rstrip())
data = list(map(int,input().split()))

count =data[0]
data.remove(data[0])

if 0 in data:
    print((0))

else:
    for _ in data:
        if count ==0:
            break
        elif count <= 10**18:
            count *= _

    if count <= 10**18:
        print(count)
    else:
        print((-1))