Problem:


Score : 100 points

Problem Statement

You are given two integers A and B.
Find the largest value among A+B, A-B and A \times B.

Constraints

-1000 \leq A,B \leq 1000

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the largest value among A+B, A-B and A \times B.

Sample Input 1

3 1

Sample Output 1

4

3+1=4, 3-1=2 and 3 \times 1=3. The largest among them is 4.

Sample Input 2

4 -2

Sample Output 2

6

The largest is 4 - (-2) = 6.

Sample Input 3

0 0

Sample Output 3

0



Sample input:
3 1


Sample output:
4

Submission status: Runtime Error

Solution code:
a, b = map(int, sys.stdin.readline().strip())
sys.stdout.write(max(a+b, a-b, a*b) + '\n')

Submission status: Runtime Error

Solution code:
a, b = map(int, sys.stdin.readline().strip)
sys.stdout.write(max(a+b, a-b, a*b) + '\n')

Submission status: Runtime Error

Solution code:
A, B = [int(i) for i in input().split()]
List = [A+B, A-B, A*B]
List = sorted(List)
print(List[3])

Submission status: Runtime Error

Solution code:
a,b=map (int,input ().split ())
print (max [a+b,a-b,a*b])

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())

if  (type(a)=b==int) and (-1000 <= a=b <=1000):
    print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a, b = input().split()
ans = max(a+b, a-b, a*b)
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

c = a + b
d = a - b
e = a * b
ary = [c, d, e]
f = max(ary)
print ("Max:", f)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print(max[a*b,a+b,a-b])

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
s,t,u=a+b,a-b,a*b
if s>t and s>u:
  print(s)
elif t>s and t>u:
  print(t)
else:
  print(u)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
s,t,u=a+b,a-b,a*b
if s>t and s>u:
  print(s)
elif t>s and t>u:
  print(t)
else:
  print(u)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
s,t,u=a+b,a-b,a*b
if s>t and s>u:
  print(s)
elif t>s and t>u:
  print(t)
else:
  print(u)

Submission status: Runtime Error

Solution code:
s,t = map(int,input().split());print(max( for i in range(3))

Submission status: Runtime Error

Solution code:
a,b=(int(i) for i in input().split())
peint(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
c = 0
list_s = [sorted(list(set(s[:i]))) for i in range(1,n)]
list_l = [sorted(list(set(s[i:]))) for i in range(1,n)]
print(max([sum([1 if list_s[j][i] in list_l[j] else 0 for i in range(len(list_s[j]))]) for j in range(n-1)]))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

ans = 0
for i in range(N):
    ans = max(ans,len(set(s[:i])) & set(s[i:]))
print(ans)

Submission status: Runtime Error

Solution code:
A, B = map(int(input()))
print(max(A+B, A-B, A*B))

Submission status: Runtime Error

Solution code:
print((lambda x:max(eval(x[0]+c+x[1])for c in"*+-"))(input()))

Submission status: Runtime Error

Solution code:
a=input()
b=a.split()
c=[int(i) for i in b]
t=c[0]+c[1]
h=c[0]-c[1]
k=c[0]*c[1]
ans=max([t,h,c])
print(ans)

Submission status: Runtime Error

Solution code:
A, B= map(int, input().split())
ans = max(A+B, A-B, A*B)
print async

Submission status: Runtime Error

Solution code:
N=int(input())
S=str(input())
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        idx=i        
idx=idx+1
sub_X=S[:idx]
sub_Y=S[idx:]
count=0
for str1 in sub_X:
    for str2 in sub_Y:
        if str1==str2:
            count+=1
            
print(int(count/2))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
print(max([a*b,a-b,a+b]))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
print(max(a*b,a-b,a+b))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
max=int(a+b)
if max<a*b:
  max=int(a*b)
else if max<a-b:
  max=int(a-b)
print(max)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
print(max(a+b,a-b,a*b)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input()) 
result_list = []
for i in range(N):    
    result_list.append(S[:i].count("W") + S[i+1:].count("E"))
print(min(result_list))

Submission status: Runtime Error

Solution code:
N=input().split()
A=N[0]
B=N[1]
Ans=A+B
if(Ans<A-B):
  Ans=A-B
  
if(Ans<A*B):
  Ans=A*B
  
print(Ans)

Submission status: Runtime Error

Solution code:
A,B=input().split()
def max(x,y):
    if x <= y:
        return(int(y))
    else:
        return(int(x))

print(max(A+B,max(A-B,A*B)))

Submission status: Runtime Error

Solution code:
A,B=input().split()
def max(x,y):
    if x <= y:
        return(y)
    else:
        return(x)

print(max(A+B,max(A-B,A*B)))

Submission status: Runtime Error

Solution code:
A,B=map(int,input())
m = max(A*B, A+B, A-B)
print(m)

Submission status: Runtime Error

Solution code:
N=int(input())
s=[x for x in input()]
#print(s)
answers=[]

for i in range(1,N+1):
    sl=s[:i]
    #print(sl)
    sr=s[i:N]

    l=sl.count("W")
    r=sr.count("E")

    ans=l+r
    #print(ans)
    answers.append(ans)
fa=min(a for a in answers)
print(fa)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())


dl = {}
dr = {}
acc = 0
for i, s in enumerate(S):
    dl[i] = acc
    if s == 'W':
        acc += 1

acc = 0
for i, s in enumerate(S[::-1]):
    dr[N - i - 1] = acc
    if s == 'E':
        acc += 1

result = N
for i in range(N):
    if result > dl[i] + dr[i]:
        result = dl[i] + dr[i]
print(result)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
return max(A+B, A-B, A*B)

Submission status: Runtime Error

Solution code:
line = input().split()

input_a = int(line[0])
input_b = int(line[1])
 
sum = input_a + input_b
sub = input_a - input_b
mul = input_a * input_b
 
if [sum > sub] and [sum>mul]:
  print(sum)
else if [sub > sum] and [sub>mul]:
  print(sub)
else:
  print(mul)

Submission status: Runtime Error

Solution code:
input_a = int(input())
input_b = int(input())
 
sum = input_a + input_b
sub = input_a - input_b
mul = input_a * input_b
 
if [sum > sub] and [sum>mul]:
  print(sum)
elif [sub > sum] and [sub>mul]:
  print(sub)
else:
  print(mul)

Submission status: Runtime Error

Solution code:
input_a = int(input())
input_b = int(input())

sum = input_a + input_b
sub = input_a - input_b
mul = input_a * input_b

if [sum > sub] and [sum>mul]:
  print(sum)
else if [sub > sum] and [sub>mul]:
  print(sub)
else:
  print(mul)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
count=0
counts=[]
for i in range(n):
    east,west = s[:i],s[i+1:]
    for n in east:
        if n=="W":
            count+=1
    for e in west:
        if e == "E":
            count +=1
    counts.append(count)
    
print(min(counts))

Submission status: Runtime Error

Solution code:
import numpy as np
a=int(input())
b=int(input())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

print max(a+b,a-b,a*b)

Submission status: Runtime Error

Solution code:
ia = input()
a = int(ia)
ib = input()
b = int(ib)

ansP = a+b
ansS = a-b
ansM = a*b

max1 = max(ansP,ansS)
max2 = max(max1, ansM)
print(max2)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
max_shurui = 0
for n in range(1,N):
    X, Y = set(S[:n]), set(S[n:])
    max_shurui = max(len(X&Y), max_shurui)
print(max_shurui)

Submission status: Runtime Error

Solution code:
A,B = (int(i) for i in input().split())  
A = l[0]
B = l[1]
print(max(A + B, A - B, A * B))

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
A = l[0]
B = l[1]
print(max(A + B,A - B,A * B))

Submission status: Runtime Error

Solution code:
A,B = map(int, raw_input().split())
A = l[0]
B = l[1]
print(max(A + B,A - B,A * B))

Submission status: Runtime Error

Solution code:
l = map(int, raw_input().split())
A = l[0]
B = l[1]
print(max(A + B,A - B,A * B))

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print(max(A+B, A−B, A×B))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
n1 = []
for i in range(n):
    s1 = set()
    for j in range(i):
        for k in range(i+1, n):
            # print(i, j, k, s[j], s[k])
            if s[j] == s[k] and set(s[j]).issubset(s1) is False:
                s1.add(s[j])
            # print('len', len(s1))
    n1.append(len(s1))
print(max(n1))

Submission status: Runtime Error

Solution code:
a,b = list(map(int,input().split()))
print(max(a-b,max(a+b,a*b))

Submission status: Runtime Error

Solution code:
a,b=max(int,input().split());print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
s=input()
west=[]
east=[]
for i in range(N):
    west.append(0)
    east.append(0)
    if(s[i]=='W'):
        west[i]=1
    else:
        east[i]=1
eastsum=np.zeros(N)
westsum=np.zeros(N)
westsum[0]=west[0]
eastsum[0]=east[N-1]
for i in range(1,N):
    eastsum[N-1-i]=eastsum[N-i]+east[N-1-i]
    westsum[i]=westsum[i-1]+west[i]
print(eastsum+westsum)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
p=a+b
m=a-b
j=a*b
i=p
if i<m:
  i=m
if i<j:
  i=j
print i

Submission status: Runtime Error

Solution code:

N=int(input())
S=list(input())
change_min=N
for leader in range(N):
    S_west=S[:leader]
    S_east=S[leader+1:N]
    change=S_west.count("W")+S_east.count("E")
    if change<=change_min:
        change_min=change
print(change_min)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
S_list=list(S)
S_max=0
for n in range(N):
    S_list_former=set(S_list[:n])
    S_list_latter=set(S_list[n:N])
    S_list_com=len(S_list_former & S_list_latter)
    if S_list_com>=S_max:
        S_max=S_list_com
print(S_max)

Submission status: Runtime Error

Solution code:
a,b=map(int,input(),split())
list=[a+b,a-b,a*b]
print(max(list))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
result = []

for i in range(n):
    count = 0
    for j in range(n):
        if (i < j) and (s[j] == "E"):
            count += 1
        elif (i > j) and (s[j] == "W"):
            count += 1
    result.append(count)

pprint(min(result))

Submission status: Runtime Error

Solution code:
a,b=map(int, raw_input.split( ))
c=max(a+b,a-b,a*b)
print c

Submission status: Runtime Error

Solution code:
n = int(input())
li = list(input())
ans = 0
for i in range(n):
  fi = li[:i-1]
  se = li[i+1:]
  hoge = fi.count('E') + se.count('W')
  if ans < hoge:
    ans = hoge
 
print(n - ans - 1)

Submission status: Runtime Error

Solution code:
num = int(input())
li = list(input())
ans = 0
for i in range(num):
  fi = set(li[:i])
  se = set(li[i:])
  hoge = len(list(fi & se))
  if hoge > ans:
    ans = hoge
 
print(ans)

Submission status: Runtime Error

Solution code:
num = int(input())
li = list(input())
i = int(num/2)
while(i<int((num/2)+1)):
  fi = set(li[:i])
  se = set(li[i:])
  ans = len(list(fi & se))
  if i < ans:
    i = ans
  else:
    i = i+1    
 
print(i)

Submission status: Runtime Error

Solution code:
num = int(input())
li = list(input())
i = int(num/2)
while(i<int(num/2)+1):
  fi = set(li[:i])
  se = set(li[i:])
  ans = len(list(fi & se))
  if i < ans:
    i = ans
  else:
    i = i+1    
 
print(i)

Submission status: Runtime Error

Solution code:
num = int(input())
li = list(input())
i = int(num/2)
while(i>num/2):
  fi = set(li[:i])
  se = set(li[i:])
  ans = len(list(fi & se))
  if i < ans:
    i = ans
  else:
    i = i+1    
 
print(i)

Submission status: Runtime Error

Solution code:
li = list(map(int,input().split()))
ans = [li[0]+li[1],li[0]-li[1],li[0]*li[1]]
ans.sort()
print(ans[3])

Submission status: Runtime Error

Solution code:
li = list(map(int,input().split()))
ans = [li[0]+li[1],li[0]-li[1],li[1]-li[0],li[0]*li[1]].sort()
print(ans[3])

Submission status: Runtime Error

Solution code:
li = input().split()
ans = [li[0]+li[1],li[0]-li[1],li[1]-li[0],li[0]*li[1]].sort()
print(ans[3])

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print(max([A+B. A-B, A*B]))

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

reS = S[::-1]

wSum = [0 for i in range(N)]
eSum = [0 for i in range(N)]

for i in range(N):
    if i == 0:
        if S[i] == 'W':
            wSum[i] = 1
        if reS[i] == 'E':
            eSum[i] = 1
    else:
        if S[i] == 'W':
            wSum[i] = wSum[i-1] + 1
        else:
            wSum[i] = wSum[i-1]
        if reS[i] == 'E':
            eSum[i] = eSum[i-1] + 1
        else:
            eSum[i] = eSum[i-1]

eSum = eSum[::-1]

cost = eSum[1]

for i in range(1,N):
    if i == N - 1:
        if cost > wSum[N-2]:
            cost = wSum[N-2]
    else:
        if cost > wSum[i-1] + eSum[i+1]:
            cost = wSum[i-1] + eSum[i+1]
print(cost)

Submission status: Runtime Error

Solution code:
n=int(input());s=input();print(max(len(set(s[:i])&set(s[i:]))for i in range(n)))

Submission status: Runtime Error

Solution code:
n=int(input());s=input();print(max(len(set(s[:i])&set(s[i:]))for i in range(n)))

Submission status: Runtime Error

Solution code:
input()
s = input()

x = 0

for i in range(len(s)):
  a = s[0:i]
  b = s[i:]
  
  x = max(x, len(set(a) & set(b)))

print(x)

Submission status: Runtime Error

Solution code:
input()
s = input()
x = 0
for i in range(len(s)):
    a = s[:i]
    b = s[i:]
    x = max(x, len(set(a) & set(b)))

print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
x = 0
for i in range(n):
    a = s[0:i]
    b = s[i:]
    x = max(x, len(set(a) & set(b)))

print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
x = 0
for i in range(n):
    a = s[0:i]
    b = s[i:]
    x = max(x, len(set(a) & set(b)))

print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
x = 0
for i in range(n):
    a = s[:i]
    b = s[i:]
    x = max(x, len(set(a) & set(b)))

print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
x = 0
for i in range(n):
    a = s[:i]
    b = s[i:]
    temp_set = set(a) & set(b)
    x = max(x, len(temp_set))

print(x)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
temp=0
for i in range(N-1):
    S1=S[0:i+1]
    S2=S[i+1:N]
#    print(S1 + " " + S2)
    kaburi=[]
    for s in S1:
        if s in S2 and s not in kaburi:
            kaburi.append(s)
    print (kaburi)
    if len(kaburi)>temp:
        temp = len(kaburi)
print(temp)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
print(max([len(set(S[:i]).intersection(set(S[i:]))) for i in range(N)]))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
 print(max(a+b,max(a-b,a*b)))

Submission status: Runtime Error

Solution code:
X = input().split()

A = int(X[0])
B = int(X[1])

p = A + B
m = A - B
k = A * B

if p > m and p > k:
    max_s = p
elif m > p and m > k:
    max_s = m
elif k > p and k > m:
    max_s = k
elif A == B and A == 0:
    max_s = p

print(max_s)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
cur=A[0]
ans=0
rp=1

for lp in range(N):
 while rp<N and cur & A[rp]==0:
  cur+=A[rp]
  rp+=1
 ans+=rp-lp
 cur-=A[lp]

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

posDevide = 1
maxMatchWordNum = 0

while posDevide <=  N - 1:
        arrayNum = 0
        matchWordNum = 0
        while arrayNum < posDevide:
                if arrayNum  == S.find( S[ arrayNum ], 0, posDevide):
                        matchWordNum = matchWordNum + 1 if  bool( S.count( S[ arrayNum ], posDevide, N )) else matchWordNum

                arrayNum += 1

        maxMatchWordNum = matchWordNum if matchWordNum > maxMatchWordNum else maxMatchWordNum
        posDevide += 1

print(maxMatchWordNum)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())

print('{}'.format(max([A+B,A-B,A*B,A/B])))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
out = [len(set(s[:i])&set(s[i:])) for i in range(n)]
print(max(out))

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split( ))
karians = []
karians.append(karians[0]-karians[1])
karians.append(karians[0]+karians[1])
karians.append(karians[0]*karians[1])
ans = max(karians)
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/python
# -*- coding:utf-8 -*-

n = int(input())
s = input()

m = n
for i in range(0, n):
    left = s[:i].count('W')
    right = s[i:].count('E')
    if left + right < m:
        m = left + right
print(m)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
min_num = 10**6


for i in range(0, N):
    num = 0
    num = sum(x == 'W' for x in S[:i]) + sum(x == 'E' for x in S[i+1:])    
    if num < min_num:
        min_num = num
        
print(min_num)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
result=0
for i in range(a,N):
  tmp = len(set(S[:i] & set(S[i:]))
  if result<tmp:
     result = tmp
print(result)

Submission status: Runtime Error

Solution code:
a,b = map(int,raw_input().split())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a,b = map(int,raw_input().split())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
def main():
    n = int(input().strip())
    a = [int(i) for i in input().split(' ')]

    c = n
    for i in range(n):
        s1, s2 = a[i], a[i]
        for j in range(i+1, n):
            s1 |= a[j]
            s2 += a[j]
            if s1 == s2:
                c += 1
            
    print(c)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())

ans = n
for i in range(len(s)):
	ans = min(ans, s[:i][:-1].count("W") + s[i:].count("E"))
	
print(ans)

Submission status: Runtime Error

Solution code:


N = int(input())
S = input()
#N = 12
#S = 'WEWEWEEEWWWE'


min = 1000000
e = S.count('E')
w = 0

for i in range(0,N-1):
    flag = 0
    now = S[i]
    if now == 'E':
        e = e - 1
    else:
        flag = 1
    sum = w + e
    if min > sum:
        min = sum
    if flag:
        w = w + 1
print(min)

Submission status: Runtime Error

Solution code:
A=int(input());B=int(input());print(max(A+B,A-B,A+B))

Submission status: Runtime Error

Solution code:
<?php
fscanf(STDIN, "%d %d", $a, $b);
$ans = max($a+$b, max($a-$b, $a*$b));
print("$ans\n");
?>

Submission status: Runtime Error

Solution code:
import sys
A = sys.stdin.readline()
B = sys.stdin.readline()

a = int(A.rstrip())
b = int(B.rstrip())
s1 = a+b
s2 = a-b
s3 = a*b

print(max(s1,s2,s3))

Submission status: Runtime Error

Solution code:
# input
a, b = (int(i) for i in input().split())

def calc(a, b):
    r1 = a + b
    r2 = a - b
    r3 = a * b

    if r1 >= r2 and r1 >= r3:
        return r1
    elif r1 =< r2 and r2 >= r3:
        return r2
    elif r1 =< r3 and r2 =< r3:
        return r3

# output
print(calc(a, b))

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print(max(A+B,
          A-B,
          A*X))

Submission status: Runtime Error

Solution code:
a,b=list(int(input().split()))
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a,b=list(int(input().split()))
print(max(a+b,a-b,a*b)

Submission status: Runtime Error

Solution code:
a,b=list(map(int,input().split()))
print(max([a+b,a-b,a*b])

Submission status: Runtime Error

Solution code:
a,b=list(map(int,input().split()))
print(max(a+b,a-b,a*b)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

ans = 0
r=0
xor_temp = 0
sum_temp = 0
for l in range(N):
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		r += 1
	xor_temp = xor_temp^A[l]
	sum_temp = sum_temp-A[l]
	ans += r-l
print (ans)

Submission status: Runtime Error

Solution code:
a, b map(int, input().split())
c=a+b
d=a-b
e=a*b
print(max([c,d,e]))

Submission status: Runtime Error

Solution code:
C = A+B
D = A-B
E = A*B
print (max([C,D,E]))

Submission status: Runtime Error

Solution code:
N = int(raw_input())
A = [int(x) for x in raw_input().split()]

ab = []
for i in range(N):
  abi = [0]*22
  for j in range(22):
    abi[j] = 0 if (A[i] & (1<<j) == 0) else 1
  ab.append(abi)

ret = 0
l = [-1]*22
for i in range(N):
  mb = -1
  for j in range(22):
    if(ab[i][j]==1):
      mb = max(mb, l[j])
  a = i - mb
  ret += a
  for j in range(22):
    if(ab[i][j]==1):
      l[j] = i
    l[j] = max(l[j], mb)
print ret

Submission status: Runtime Error

Solution code:
A,B=map(int,raw_input().split(' '))

print(max(A+B, A-B, A*B))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 26 22:01:36 2018

@author: maezawa
"""

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

cnt = 0
l=0
r=0

sum_a = a[0]
xor_a = a[0]

while True:
    if sum_a == xor_a:
        cnt += 1
        if r<n-1:
            r += 1        
            sum_a += a[r]
            xor_a ^= a[r]
            continue
    l += 1
    r -= 1
    if l == n:
        break
    sum_a -= a[l-1]+a[r+1]
    xor_a ^= a[l-1]^a[r+1]
    #xor_a ^= a[r+1]
    
print(cnt)

Submission status: Runtime Error

Solution code:
x = A+B
y = A-B
z = A*B

print(max(x,y,z))

Submission status: Runtime Error

Solution code:
x = A+B
Y = A-B
Z = A*B

print(max(X,Y,Z))

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
print(max([A*B, A+B, A-B])

Submission status: Runtime Error

Solution code:
m = input()
s = m.split()
a = s[0]
b =s[1]
c = a + b
d = a - b
e = a * b
f = {}
f["a+b"] = c
f["a-b"] = d
f["a*b"]= e
print(f.values(0))

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p, x = 0, 0
    for j in range(i, n):
        p += A[j]
        x ^= A[j]
        if p == x:
            r += 1
        else:
            break
print(r)

Submission status: Runtime Error

Solution code:
import collections

n = int(input())
s = input()
min_people = n - 1

def we_counter(pos):
  front = s[:pos]
  back = s[pos+1:]
  people = front.count('W') + back.count('E')
  return people


for i in range(n):
  people = we_counter(i)

  if people < min_people:
    min_people = people

print(min_people)

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()

count=0
i=0
j=N-1

while i<j:
    if s[i]=="E":
        i+=1
        continue
    if s[j]=="W":
        j-=1
        continue
    sub_i=i
    sub_j=j
    j_i=0
    j_j=0
    while s[sub_i]=="W":
        sub_i+=1
        j_i+=1
    while s[sub_j]=="E":
        sub_j-=1
        j_j+=1
    if j_i<j_j:
        i=sub_i
        count+=1
    else:
        j=sub_j
        count+=1
    
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = N
j = 1
s = A[0] + A[1] if N > 0 else A[0]
x = A[0] | A[1] if N > 0 else A[0]
for i, a in enumerate(A):
    x = a
    s = a
    if j == i:
        j += 1
    if j == N:
        break
    for k in range(j-i):
        x = x | A[1 + i + k]
        s += A[1 + i + k]
    while True:
        if j == N:
            break
        if s == x:
            ans += j-i
            j += 1
            if j == N:
                break
            s += A[j]
            x = x | A[j]
        else:
            break

print(ans)

Submission status: Runtime Error

Solution code:
#include <stdio.h>
#include <math.h>

int count(char *s, char c, int N1, int N2)
{
  int i, num = 0;
  for (i = N1; i < N2; ++i)
  {
    if (s[i] == c) ++num;
  }
  return num;
}

int main()
{
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);

  int n_list[N];
  int j;
  for (j = 0; j < N: ++j)
  {
    n_list[j] = 0;
  }

  int num = 0;
  num += count(S, 'E', 1, N);
  n_list[0] = num;
  int i;
  for (i = 1; i < N - 2; ++i)
  {
    num = 0;
    num += count(S, 'W', 0, i-1);
    num += count(S, 'E', i+1, N);
    n_list[i] = num;
  }
  num = 0;
  num += count(S, 'W', 0, N-1);
  n_list[0] = num;

  num = 10;
  for (i = 0; i < N; ++i)
  {
    printf("%d\n", n_list[i]);
    if (n_list[i] < num) num = n_list[i];
  }

  printf("%d", num);
}

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()

count=0
i=0
j=N-1

while i<=j:
    if s[i]=="E":
        i+=1
        continue
    if s[j]=="W":
        j-=1
        continue
    sub_i=i+1
    sub_j=j-1
    j_i=0
    j_j=0
    while s[sub_i]=="E":
        sub_i+=1
        j_i+=1
    while s[sub_j]=="W":
        sub_j-=1
        j_j+=1
    if j_i>j_j:
        i=sub_i
        count+=1
    else:
        j=sub_j
        count+=1

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
if a==0&&b==0:
  print(max([a+b,a-b,a*b]))
else:
  print(max([a+b,a-b,a*b,a/b]))

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
if a!=0&&b!=0:
  print(max([a+b,a-b,a*b]))
else:
  print(max([a+b,a-b,a*b,a/b]))

Submission status: Runtime Error

Solution code:
#Attention

#ライブラリ
import copy

#入力
N = int(input())
S = list(input())
ans = []
#計算
for i in range(1,N-1,1):
	S_hidari = copy.copy(S[0:i])
	S_migi = copy.copy(S[i+1:N])
	if i == 1:
		ans.append(S_hidari.count('W')-1+S_migi.count('E'))
		break
	if i == N-2:
		ans.append(S_hidari.count('W')+S_migi.count('E')-1)
		break
	ans.append(S_hidari.count('W')+S_migi.count('E'))
	

print(min(ans))

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
if a==b:
  print(max([a+b,a-b,a*b]))
else:
  print(max([a+b,a-b,a*b,a/b]))

Submission status: Runtime Error

Solution code:
a、b=map(int, input(),split())
x =a+b
y =a-b
z =a*b
print(max(x,y,z))

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
if a!=b:
  print(max([a+b,a-b,a*b]))
else:
  print(max([a+b,a-b,a*b,a/b]))

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
print(max([a+b,a-b,a*b,a/b]))

Submission status: Runtime Error

Solution code:
num=input().split()
a=int(num[0])
b=int(num[1])
print(max[a+b,a-b,a*b,a/b])

Submission status: Runtime Error

Solution code:
n=int(input())
x=input()
s=list(x)
 
list=[]
for i in range(n):
    a=0
    l=s[:i]
    a+=l.count("W")
    k=s[i+1:]
    a+=k.count("E")
    list.append(a)
 
f=min(list)

print(f)

Submission status: Runtime Error

Solution code:
n=int(input())
x=input()
s=list(x)
 
list=[]
for i in range(n):
    a=0
    l=s[:i]
    a+=l.count("W")
    k=s[i+1:]
    a+=k.count("E")
    list.append(a)
 
f=min(list)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input().rstrip())

count_list = []
for i in range(N):
    count = 0
    for j in range(i):
        if S[j] == 'W':
            count += 1
    for j in range(N-i-1):
        if S[i+j+1] == 'E':
            count += 1

    
    count_list.append(count)

print(min(count_list))

Submission status: Runtime Error

Solution code:
A= int(input())
B= int(input())
print(max(A+B,A-B,A*B))

Submission status: Runtime Error

Solution code:
N = int(raw_input())
A = map(int,raw_input().split())

all_count = 0
for i in range(N):
	a_x = A[i]
	a_s = A[i]
	count=1
	flag = True
	for j in range(N-i-1):
		if flag:
			a_x = a_x ^ A[i+j+1]
			a_s = a_x | A[i+j+1]
			if a_x == a_s:
				count+=1
			else:
				flag=False
	all_count += count
	
print all_count

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

match = 0
for l in range(len(A)):
    base = A[l]
    match += 1
    for r in range(l+1, len(A)):
        ando = base & A[r]
        if ando == 0:
            match += 1
        else:
            break
        base |= A[r]

print(match)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
print(max(A+B,A-B,A*B))

Submission status: Runtime Error

Solution code:
A= input()
B= input()
print(max(A+B,A-B,A*B))

Submission status: Runtime Error

Solution code:
n=int(input())
x=input()
s=list(x)
list=[]
 
for i in range(n):
    a=0
    moji=[]
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k+i-1]:
                if s[j] not in moji:
                    a+=1
                    moji.append(s[j])
    list.append(a)
 
f=max(list)
print(f)

Submission status: Runtime Error

Solution code:
n=int(input())
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k+i-1]:
                a+=1
    list.append(a)

f=max(list)
print(f)

Submission status: Runtime Error

Solution code:
n=int(input())
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k]:
                a+=1
    list.append(a)

f=max(list)
print(f)

Submission status: Runtime Error

Solution code:
N = input()
S = list(input())

Ans = 0

for i in range(len(S)):
	X = set(S[:i])
	Y=set(S[i:])
	numAND = len(X & Y)
	if numAND >= Ans:
		Ans = numAND
print(Ans)

Submission status: Runtime Error

Solution code:

N = int(input().split())
ans = []
ans.append(N[0]+N[1])
ans.append(N[0]-N[1])
ans.append(N[0]*N[1])

print(max(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
maxd = 0
for a in range(1,N-1):
    X = set([])
    Y = set([])
    for x in range(0,a):
        X.add(S[x])
    for y in range(a,N):
        Y.add(S[y])
    diffnum = len(X&Y)
    maxd = max(diffnum,maxd)
print(maxd)

Submission status: Runtime Error

Solution code:

N = int(input().split(","))
ans = []
ans.append(N[0]+N[1])
ans.append(N[0]-N[1])
ans.append(N[0]*N[1])

print(max(ans))

Submission status: Runtime Error

Solution code:
N = int(raw_input())
S = raw_input()

num = S[1:].count('E')
score_list = []
score_list.append(num)

for i in range(N-1):
	if i==0:
	
		if S[i]=='W':
			num+=1
	else:
		if S[i]=='W':
			num+=1
		else:
			num-=1
	score_list.append(num)
	
print min(score_list)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
m=0
for i in range(n-1):
    x=s[:i]
    y=s[i:]
    x=set(x)
    y=set(y)
    z=x.intersection(y)
    m=max(len(z),m)
print(m)

Submission status: Runtime Error

Solution code:
#include<stdio.h>

int main(int argc, char* argv[]){
  int a,b,c[3];

  scanf("%d %d", &a, &b);
  c[0] = a+b;
  c[1] = a-b;
  c[2] = a*b;

  if(c[0] > c[1] && c[0] >c[2]){
    printf("%d\n", c[0]);
  }else if(c[1] > c[0] && c[1] >c[2]){
    printf("%d\n", c[1]);
  }else{
    printf("%d\n", c[2]);
  }

  return 0;
}

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

temp = a + b
minus = a - b
multi = a * b

if temp  <  minus :
	temp = minus

if temp < multi :
	temp = multi

print(temp)

Submission status: Runtime Error

Solution code:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max[c, d, e]

print(f)

Submission status: Runtime Error

Solution code:

  2 line = input()
  3 line = line.split()
  6
  7 A = int(line[0])
  8 B = int(line[1])
  9 print(max(A + B, A - B, A * B))
~
~
~
~

Submission status: Runtime Error

Solution code:
a, b= map(int, input().split())

c=a+b
d=a-b
e=a*b

print(max[c, d, e])

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())

print(max(A+B,A-B,A*B)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

print(max(a+b, a-b, a*b)