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:
N = int(input())
A = list(map(int, input().split()))
A2 = []
Z = []
ans = 0
zerocnt = 0
for ai in A:
    if ai == 0:
        zerocnt += 1
    elif zerocnt >= 1:
        A2 += [0]
        Z += [zerocnt]
        ans += (zerocnt * (zerocnt+1)) // 2
        zerocnt = 0
    if ai != 0:
        A2 += [ai]
        Z += [1]
        ans += 1

if zerocnt >= 1:
    A2 += [0]
    Z += [zerocnt]
    ans += (zerocnt * (zerocnt+1)) // 2
    zerocnt = 0

for i, ai in enumerate(A2):
    aixor = ai
    sumA = ai
    for j in range(i+1, min(i+41, len(A2))):
        aj = A2[j]
        aixor = aixor ^ aj
        sumA += aj
        if aixor != sumA:
            break
        else:
            ans += (Z[i] * Z[j])
        
print(ans)

Submission status: Runtime Error

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

max_count = 0
for i in range(0, N-1):
  X = S[0:i+1]
  Y = S[i+1:]

  X_set = set(X)
  Y_set = set(Y)

  count = len(X_set & Y_set)
  if max_count < count:
    max_count = count

print(max_count)

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())

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

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 = max(int,input().split())
print(max(A+B,A-B,A*B))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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, c = list(map(int, input().split()))
my_result = max(a+b, a-b, a*b)
print(my_result)

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:
a,b = map(int, input().split())
print(min(a+b,min(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())
l = list(map(str,input()))

ans = 0
for i in range(n):
    a = l[0:i]
    b = l[i:n-1]
    tmp = []
    for j in a:
        if j in b:
            tmp.append(j)
    tmp = set(tmp)
    ans = (max(ans,len(tmp)))

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
e=s.count("E")
w=n-e
ans=e
nume=0
numw=0
for i in range(n):
    if s[i]=="E":
        nume+=1
    else:
        numw+=1
    ans=min(ans,numw+e-nume)
print(ans)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
print(min({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:
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:
a,b = map(int,input().split())
print(max([a+b,a-b,a*b])

Submission status: Runtime Error

Solution code:
a, b = int(input())
s = a+b
t = a-b
p = a*b
li = [s, t, p]
li.sort()
print(li[-1])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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:
n = int(input())
s = input()

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
ln = list(map(int, input().replace('W', '0 ').replace('E', '1 ').split()))

# 先頭だけ先に計算（do-while相当）
w_sum = 0                           # 西側で振り返る人
sum_min = e_sum = sum(ln) - ln[0]   # 東側で振り返る人

for i in range(1, n-1):
    #sum_min = min(sum_min, sum(ln[i+1:n]) + (i - sum(ln[0:i])))
    w_sum += 1 if ln[i-1] == 0 else 0
    e_sum -= ln[i]
    sum_min = min(sum_min, w_sum + e_sum)

# 末尾も個別に計算
else:
    w_sum += 1 if ln[n-1] == 0 else 0
    sum_min = min(sum_min, w_sum)

print(sum_min)

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().splitz())

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:
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])

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(),input().split())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
A, B = map(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))

Submission status: Runtime Error

Solution code:
line = input()
num_a, num_b = [int(n) for n in line.split()][0]
print(max([num_a + num_b, num_a - num_b, num_a * num_b]))

Submission status: Runtime Error

Solution code:
maior=0
A = int(input())
B = int(input())
lista = [A+B, A-B, A*B]
for i in range(0,3):
    if lista[i]> maior:
        maior = lista[i]
print(maior)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
soma, mult, minus = a+b, a*b, a-b 
if(soma > mult and soma > minus):
    print(soma)
elif(mult > minus):
    print(mult)
else:
    print(minus)

Submission status: Runtime Error

Solution code:
line = input()
A,B = [int(u) for u in line.split()]
def func(a,b)
    return min(a+b,a-b,a*b)
print(func(A,B))

Submission status: Runtime Error

Solution code:
line = input()
A,B = [int(u) for u in line]
def func(a,b)
    return min(a+b,a-b,a*b)
print(func(A,B))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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(min(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:
A,B = map(int,input().split())
 
return(max([A+B, A-B, A*B]))

Submission status: Runtime Error

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

a1 = A + B
a2 = A - B
a3 = A * B

if a1 >= a2 and a1 >= a3:
	print(a1)
elif a2 >= a1 and a>= a3:
	print(a2)
elif a3 >= a1 and a3 >=a2:
	print(a3)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
A = list(map(int,input().split()))
X = [0]
C = [0] + np.cumsum(A).tolist()
for i in range(n):
    X.append(X[i-1] ^ A[i])
cnt = 0
for l in range(n):
    for r in range(l+1, n):
        if C[r]-C[l] == X[r]^X[l]:
            cnt += 1
print(cnt+n)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
    int A, B;
    int M=0;
    cin >> A >> B;
    if(M < (A+B)){
        M = A+B;
    }
    if(M < (A-B)){
        M = A-B;
    }
    if(M < (A*B)){
        M = A*B;
    }
    
    cout << M << endl;
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
    int A, B;
    int M=0;
    cin >> A >> B;
    if(M < A+B){
        M = A+B;
    }
    if(M < A-B){
        M = A-B;
    }
    if(M < A*B){
        M = A*B;
    }
    
    cout << M << endl;
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
    int A, B;
    int M=0;
    array<int, 2> ar;
    cin >> A >> B;
    if(M<A+B){
        M = A+B;
    }
    if(M<A-B){
        M = A-B;
    }
    if(M<A*B){
        M = A*B;
    }
    
    cout << M << endl;
}

Submission status: Runtime Error

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

ans = [a+b, a-b, a*b]
print(max[ans])

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]))

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)

Submission status: Runtime Error

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

ans = float('inf')
w_left = [0]
e_right = [0]*n

for i in range(1,n):
  if s[i-1] == 'W':
    w_left.append(w_left[i-1]+1)
  else :
    w_left.append(w_left[i-1])
      
for i in range(1,n):
  if s[n-i] == 'E':
    e_right[n-i-1] = e_right[n-i]+1
  else :
    e_right[n-i-1] = e_right[n-i]

for i in range(n):
    ans = min(ans , w_left[i]+e_right[i])
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=int(input())
x=a+b
y=a-b
z=a*b
list=[x,y,z]
ans=max(list)
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
x=a+b
y=a-b
z=a*b
ans=max([x,y,z])
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
li=list(input())

min = 100000000

w = 0

for index, i in enumerate(li):
  a = 0
  if i == 'W':
    w += 1
  
  s = li[index + 1:].count('E')

  a = w + s
    
  if min > a:
    min = a
    
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:
N = int(input())
S = input()
#------------------------------
#########タイムオーバー########
#------------------------------
# minimum = 300000
# for i in range(N):
    # leftWestNum = S[:i].count('W')
    # rightEstNum = S[i+1:N].count('E')
    # tmpMin = leftWestNum + rightEstNum
    # if tmpMin < minimum:
        # minimum = tmpMin
# print(minimum)

minimum = 3000000
numEast = [0] * (N+1)
numWest = [0] * (N+1)
for i in range(N):
    if S[i] == 'E':
        numEast[i+1] = numEast[i] + 1
        numWest[i+1] = numWest[i]
    else:
        numEast[i+1] = numEast[i]
        numWest[i+1] = numWest[i] + 1

for i in range(N):
    tmpMin = numWest[i] + (numEast[N]-numEast[i])
    if tmpMin < minimum:
        minimum = tmpMin

print(minimum)

Submission status: Runtime Error

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

lis = [a+b, a-b, a*c]
print(max(lis))

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())
print(max([A + B, A - B, A * B]))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int a, b;
    cin >> a >> b;
    vector<int> v;
    v.push_back(a+b);
    v.push_back(a-b);
    v.push_back(a*b);
    OUT(*max_element(ALL(v)))

    return 0;
}

Submission status: Runtime Error

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

w = 0
e = 0
for i in s:
  if i =="W":
    pass
  else:
    e +=1
n=e
for i in s:
  if i=="E":
    e-=1
    n = min(n,e+w)
  if i =="W":
    w+=1
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n,k = map(int,input().split())
print(max(m+k,n-k,n*k))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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=map(int,input().split())
X=A*B
Y=A-B
X=A+B
print(max(X,Y,Z))

Submission status: Runtime Error

Solution code:
from collections import Counter
N = int(input())
S = input()

count = N
for i in range(N):
    c = 0
    for s1 in S[i:]:
        c += 0 if s1 == 'W' else 1
    for s2 in S[:i]:
        c += 0 if s2 == 'E' else 1
    count = c if c < count else count
    if count == 1:
        break

print(count)

Submission status: Runtime Error

Solution code:
A, B = int(input())

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))
a = l[0]
b = l[1]

ans1 = a + b
ans2 = a - b
ans3 = a * b

print(max(ans1, ans2, ans3)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
answer = n
left_count = 0
right_count = s.count('E')
for i in range(n):
  if i != 0 and s[i-1] == 'W':
    left_count += 1
  if s[i] == 'E':
    right_count -= 1
  total = left_count + right_count
  answer = min(answer, total)
print(answer)

Submission status: Runtime Error

Solution code:
A,B = int(input().split())
S = A + B
D = A - B
P = A * B
M = S
if D > M:
  M = D
if P > M:
  M = P
print(M)

Submission status: Runtime Error

Solution code:
A,B = input().split()
S = A + B
D = A - B
P = A * B
M = S
if D > M:
  M = D
if P > M:
  M = P
print(M)

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())
s=[]
s.append(a+b,a-b,a*b)
print(max(s))

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,c = 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, ab))

Submission status: Runtime Error

Solution code:
def main(a, b):
    add = a + b
    sub = a - b
    mul = a * b

    return max(add, sub, mul)


if __name__ == "__main__":
    a, b = input().split(' ')
    print(main(a, b))

Submission status: Runtime Error

Solution code:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[-1])

Submission status: Runtime Error

Solution code:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = [a+b, a-b, a*b , a//b]

print(ans[-1])

Submission status: Runtime Error

Solution code:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[0])

Submission status: Runtime Error

Solution code:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
S = input()
ans = S.count('E')
tmp = ans
for i in range(N-1):
    if S[i] == 'W':
        tmp += 1
    if S[i + 1] == 'E':
        tmp -= 1
    ans = min(tmp, ans)
print(str(ans))

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:
def resolve():
    a, b, = int(input())
    ans = max([a + b, a - b, a * b])
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

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


if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;

int main(void){
    int a,b;
    cin>>a>>b;
    if(a+b > a-b && a+b > a*b){
        cout<<a+b<<endl;
    }else if(a-b > a*b){
        cout<<a-b<<endl;
    }else{
        cout<<a*b<<endl;
    }
}

Submission status: Runtime Error

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

# print(N, S)
ans = N

for i, h in enumerate(range(N)):
    skipflg = False
    f = S[0: i]
    l = S[i]
    s = S[i+1:]
    # print(f, l, s)
    nw = 0
    ne = 0
    nw = f.count('W')
    ne = s.count('E')
    # print(nw, ne)
    # for r in f:
    #     if r != 'E':
    #         nw += 1
    #         if nw >= ans:
    #             skipflg = True
    #             break
    #         # print('not e')

    # if skipflg:
    #     break

    # for w in s:
    #     if w != 'W':
    #         ne += 1
    #         if nw+ne >= ans:
    #             skipflg = True
    #             break
    #         # print('not w')

    # if skipflg:
    #     break

    ans = min(ans, nw+ne)

print(ans)

Submission status: Runtime Error

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

# print(N, S)
ans = N

for i, h in enumerate(range(N)):
    skipflg = False
    f = S[0: i]
    l = S[i]
    s = S[i+1:]
    print(f, l, s)
    nw = 0
    ne = 0
    nw = f.count('W')
    ne = s.count('E')
    print(nw, ne)
    # for r in f:
    #     if r != 'E':
    #         nw += 1
    #         if nw >= ans:
    #             skipflg = True
    #             break
    #         # print('not e')

    # if skipflg:
    #     break

    # for w in s:
    #     if w != 'W':
    #         ne += 1
    #         if nw+ne >= ans:
    #             skipflg = True
    #             break
    #         # print('not w')

    # if skipflg:
    #     break

    ans = min(ans, nw+ne)

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    print(max(a + b, a - b, a * b))
    return

#B
def B():
    return

#C
def C():
    n = II()
    s = S()
    dp = [0 for i in range(n)]
    for num,si in enumerate(s):
        if si == "E":
            dp[num] = dp[num-1]+1
        else:
            dp[num] = dp[num - 1]
    ans = float("INF")
    a = max(dp)
    for i in range(n):
        ans = min(ans,  a - dp[i] + i - dp[i] + (s[i] == "E"))
    
    print(ans)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
East = [0] * (N)
if S[0] == "E":
    East[0] = 1
for i in range(N-1):
    if i == N-1:
        break
    if S[i+1] == 'E':
        East[i+1] = East[i] + 1
    else:
        East[i+1] = East[i]
# print(East)
result = East[N-1] -East[1]
for i in range(1,N):
    if i == N-1:
        ans = (i-1) -East[i-2]
    elif i == 1:
        ans = East[N-1] - East[i+1]
    else:
        right_E = East[N-1] - East[i+1]
        left_W = (i-1) -East[i-2]
        ans = right_E + left_W
    if result > ans:
        result = ans
        # print(i)
print(result)

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()
w=ans=9**9

for i in range(N):
    e=S[:i].count("W")
    w=S[i:].count("E")
    ans=min(ans,e+w)
    if w=0:break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input().split()
int(a)

list=[a[0]+a[1],a[0]-b.a[1],a[0]*a[1]]
print(max(list))

Submission status: Runtime Error

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

list=[a[0]+a[1],a[0]-b.a[1],a[0]*a[1]]
print(max(list))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

w = [0]
e = [0]

# tmp_w = 0
tmp_e = 0

for i in range(1, n):

    j = (n - 1) - i

    if (s[i-1] == 'W'):
        w.append(w[i-1] + 1)
        # tmp_w += 1
    else:
        w.append(w[i-1])

    if (s[j+1] == 'E'):
        e.append(tmp_e + 1)
        tmp_e += 1
    else:
        e.append(tmp_e)

e.reverse()

ans = 10 ** 6 
for i in range(n):
    ans = w[i] + e[i] if w[i] + e[i] < ans else ans

print(ans)

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 = int(input())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

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

    count = 0
    max_ = 0

    for i in range(N):
        x = set(S[:i])
        y = set(S[i:])

        max_ = max(len(x&y), max_)

    print(max_)


if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int, input().split()))
cnt=0
t=0
ans=0
tmp=0
for s in range(n):
    while t<n and tmp^a[t]==tmp+a[t]:
        tmp=tmp^a[t]
        t+=1
    ans+=t-s   
    tmp-=a[s]
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if B < 0:
    print(A - B)
elif A > 1 and B > 1:
    print(A * B)
else A ==1 or B == 1:
    print(A + B)

Submission status: Runtime Error

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

if A < 0 or b < 0:
    print(abs(A) + abs(B))
else:
    print(A * B)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

max = -1000
if A + B > max:
    max = A + B
if A - B > max:
    max = A - B
if A * B > max:
    max = 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:
a, b, c=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(str(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:
A, B = [int(x) for x in input().split()]

calc_res = [A+B, A-B, A*B, A/B]
print(max(calc_res))

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:
import numpy as np

n = int(input())
string = input()

lst_w = []
lst_e = []

count = 0
for i in string:
    if i == 'W':
        lst_w.append(count)
        count += 1
    else:
        lst_w.append(count)
        
count = 0
for i in string[::-1]:
    if i == 'E':
        lst_e.append(count)
        count += 1
    else:
        lst_e.append(count)
lst_e = lst_e[::-1]

print(min(np.array(lst_w) + np.array(lst_e)))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or abs(a-b)<=d>=abs(b-c):print("Yes")
else:print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int(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))

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))

Submission status: Runtime Error

Solution code:
a,b = map(lambda x: int(x) for x in input().split())

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())
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())
c = a+b
d = a-b
e = a*b
print(max(c, d. e))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(input())
ans=0
for i in range(N-1):
    a=set(S[:i+1])
    b=set(S[i+1:])
    ans=max(ans,len(a&b))
print(ans)

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();print(max(len(set(s[:i])&set(s[i:]))for i in range(n)))
#copy code

Submission status: Runtime Error

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

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())

add = A + B
sub = A - b
mui = A * B

print(max(add, sub, mui))

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=int(input().split())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a,b=int(input().split())
print(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:
a,b=int(input().split())

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
a = s[1:].count('E')
inf = float('inf')
ans = [inf]*n
ans[0] = a
for i in range(1,n):

    if s[i] == 'E':
        ans[i] = ans[i-1] - 1
    else:
        ans[i] = ans[i-1]

    if s[i-1] == 'W':
        ans[i] += 1
    else:
        continue

print(min(ans))

Submission status: Runtime Error

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

intger2 = 0

for i in range(N):
  intger1 = 0
  str1 = list(set(S[i + 1:]))
  str2 = list(set(S[:i + 1]))
  l = len(str2)
  
  for j in range(l):
    if( str2[j] in str1):
      intger1 += 1
      
    else:
      continue
  
  if( intger2 <= intger1):
    intger2 = intger1
    
  else:
    continue
    
print(intger2)

Submission status: Runtime Error

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

C1 = A + B
C.append(C1)

C2 = A - B
C.append(C2)

C3 = A * B
C.apend(C3)

C = sorted(C)

print(C[2])

Submission status: Runtime Error

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

C1 = A + B
C2 = A - B
C3 = A * B

C = [ C1, C2, C3 ]

C = sorted.C

print(C[2])

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(str(input()))
p = s.count("E")
ans = p
for i in s:
    if i == "W":
        p += 1
    else:
        p -= 1
    ans = min(p, ans)
print(ans)