Question:
We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds.

Initially, the hand of every clock stands still, pointing directly upward.

Now, Dolphin starts all the clocks simultaneously.

Every second, Dolphin thinks about manually resetting the i-th clock back to 0.

In how many seconds will the hand of every clock point directly upward again?

-----Constraints-----
 - 1≤N≤100
 - 1≤T_i≤10^{18}
 - All input values are integers.
 - The correct answer is at most 10^{18} seconds.

-----Input-----
Input is given from Standard Input in the following format:
N
T_1
:
T_N

-----Output-----
Print the number of seconds after which the hand of every clock point directly upward again.

-----Sample Input-----
2
2
3

-----Sample Output-----
6

We have two clocks. The time when the hand of each clock points upward is as follows:
 - Clock 1: 2, 4, 6, ... seconds after the beginning
 - Clock 2: 3, 6, 9, ... seconds after the beginning
Therefore, it takes 6 seconds until the hands of both clocks point directly upward.

["\nimport math\nfrom functools import reduce\n\nurl = \"https://atcoder.jp//contests/abc070/tasks/abc070_c\"\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm(*numbers):\n    return reduce(lcm_base, numbers, 1)\n\ndef main():\n    count = int(input())\n    clocks = []\n    for i in range(count):\n        clocks.append(int(input()))\n    print((lcm(*clocks)))\n\ndef __starting_point():\n    main()\n\n__starting_point()", "import math\n\ndef lcm(x, y):\n    return x * y // math.gcd(x, y)\n\nn = int(input())\nt = int(input())\n\nfor i in range(n - 1):\n    num = int(input())\n    t = lcm(t, num)\nprint(t)", "import math\n\nN = int(input())\nT = [int(input())for _ in range(N)]\n\nans = T[0]\n\nfor i in range(1,N):\n    ans = (ans*T[i])//math.gcd(ans,T[i])\n    ans %= 10**18+7\nprint(ans)\n    \n", "import math\n\nn = int(input())\ntl = list(int(input()) for _ in range(n))\n\nif n == 1:\n    print(tl[0])\nelse:\n    ans = tl[0]\n    for i in range(1, n):\n        ans = ans//math.gcd(ans, tl[i])*tl[i]\n\n    print(ans)", "import math\n\ndef lcm(a,b):\n    return a*b//math.gcd(a,b)\n\nN=int(input())\nT=[int(input()) for _ in range(N)]\nans=1\nfor t in T:\n    ans=lcm(ans,t)\nprint(ans)\n", "from functools import reduce\nfrom fractions import gcd\n\nN = int(input())\nT = list(int(input()) for _ in range(N))\n\ndef lcm_base(x, y):\n    return (x*y)//gcd(x, y)\n\ndef lcm(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nprint((lcm(T)))\n", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm(*numbers):\n    return reduce(lcm_base, numbers, 1)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nn = int(input())\nt = [int(input()) for _ in range(n)]\n\nprint(lcm(*t))", "import math\n\nN = int(input())\nT = [0] * N\nfor i in range(N):\n    T[i] = int(input())\n\nif N == 1:\n    print((T[0]))\nelif N == 2:\n    print((T[0]*T[1]//math.gcd(T[0], T[1])))\nelse:\n    L = T[0]\n    for i in range(1, N):\n        L = L*T[i]//math.gcd(L, T[i])\n    print(L)\n", "import math\n\n\ndef lcm(a, b):\n    return a * b // math.gcd(a, b)\n\n\nN = int(input())\nans = int(input())\nfor _ in range(N - 1):\n    ans = lcm(ans, int(input()))\nprint(ans)", "import math\nN=int(input())\na = [int(input()) for _ in range(N)]\nans = a[0]\nfor i in range(1, N):\n    ans = ans * a[i] // math.gcd(ans, a[i])\nprint(ans)", "N=int(input())\nT=[int(input()) for _ in range(N)]\n\nimport math\nfrom functools import reduce\n\nprint(reduce(lambda x,y : (x * y) // math.gcd(x, y), T,1))", "from math import gcd\n\nN = int(input())\n\nall_t = []\ngcd_all = 0\n\nif N >= 2:\n  for i in range(N):\n    all_t.append(int(input()))\n\n    if i == 1:\n      gcd_all = gcd(all_t[0], all_t[1])\n      base = int(all_t[0] * all_t[1] // gcd_all)\n    elif i >= 2:\n      gcd_all = gcd(base, all_t[i])\n      base = int(base * all_t[i] // gcd_all)\n  print(base)\nelse:\n  print((int(input())))\n", "from math import *\n\nN=int(input())\nT=list(int(input()) for _ in range(N))\nans=T[0]\nfor i in range(1,N):\n  ans=ans*T[i]//gcd(ans,T[i])\nprint(ans)\n", "import math\ndef gcd(a, b):\n    while b:\n        a, b = b, a % b\n    return a\ndef lcm(x, y):\n    return (x * y) // gcd(x, y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n    print((T[0]))\n    return\n\nans = lcm(T[0] , T[1])\nfor i in range(2 , N):\n    ans = lcm(T[i] , ans)\nprint(ans)\n", "import numpy as np\nn = int(input())\nlis = []\nfor i in range(n):\n    lis.append(int(input()))\nprint(np.lcm.reduce(lis))", "from math import gcd\nn = int(input())\nt = list([int(input()) for _ in range(n)])\nx = 1\nfor i in t:\n    x = x*i//gcd(x,i)\nprint(x)", "import math\nN = int(input())\nlcm = int(input()) #T0\nfor i in range(N-1):\n    x = int(input())\n    lcm = lcm * x // math.gcd(lcm,x)\nprint(lcm)", "n = int(input())\nt = [int(input()) for _ in range(n)]\n\nimport math\nfrom functools import reduce\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\ndef lcm(*numbers):\n    return reduce(lcm_base, numbers, 1)\nprint(lcm(*t))", "import sys\nimport math\npin=sys.stdin.readline\n\ndef main():\n  N=int(pin())\n  ans=int(pin())\n  for i in range(N-1):\n    T=int(pin())\n    ans=(ans*T)//math.gcd(ans,T)\n  print(ans)\n  return\nmain()", "import fractions\nn=int(input())\nt=[]\nfor _ in range(n):\n    T=int(input())\n    t.append(T)\nans=t[0]\nfor i in range(1, len(t)):\n    ans = ans * t[i] // fractions.gcd(ans, t[i])\nprint(ans)    ", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n\treturn (x * y) // math.gcd(x, y)\n\ndef lcm(*numbers):\n\treturn reduce(lcm_base, numbers, 1)\n\ndef lcm_list(numbers):\n\treturn reduce(lcm_base, numbers, 1)\n\nn = int(input())\nt = [0]*n\nfor i in range(n):\n\tt[i] = int(input())\nprint(lcm_list(t))", "import math\ndef lcm(x, y):\n    return (x * y) // math.gcd(x, y)\n\nN=int(input())\na=int(input())\nfor i in range(N-1):\n    a=lcm(a,int(input()))\nprint(a)\n", "def lcm(m, n):\n    return m//gcd(m, n)*n\n\n\ndef gcd(m, n):\n    r = m % n\n    return gcd(n, r) if r else n\n\n\nn = int(input())\narr = [int(input()) for _ in range(n)]\nans = 1\nfor i in arr:\n    ans = lcm(ans, i)\n\nprint(ans)", "import math\nN = int(input())\nT = int(input())\nfor i in range(N-1):\n    t = int(input())\n    T = T // math.gcd(T, t) * t\nprint(T)", "import math\ndef lcm(x, y):\n    return (x * y) // math.gcd(x, y)\n\nn=int(input())\nt=[]\nfor i in range(n):\n    t.append(int(input()))\n\nans=t[0]\nfor i in range(1,n):\n    ans=lcm(ans,t[i])\nprint(ans)\n", "def delete_head_zeros(n):\n\tn = str(n)\n\tl = len(n)\n\tif \".\" in n:\n\t\tl = n.find(\".\")\n\thead_zeros = 0\n\tfor i in range(l - 1):\n\t\tif n[i] == \"0\":\n\t\t\thead_zeros += 1\n\t\telse:\n\t\t\tbreak\n\n\treturn n[head_zeros:]\n\n# compare a, b\n# a, b: int or string\ndef bigint_compare(a, b):\n\ta = delete_head_zeros(a)\n\tb = delete_head_zeros(b)\n\tif len(a) > len(b):\n\t\treturn 1\n\telif len(a) < len(b):\n\t\treturn -1\n\telse:\n\t\tif a > b:\n\t\t\treturn 1\n\t\telif a < b:\n\t\t\treturn -1\n\t\telse:\n\t\t\treturn 0\n\n# calculate a + b\n# a, b: int or string\ndef bigint_plus(a, b):\n\ta = str(a)\n\tb = str(b)\n\n\td = max([len(a), len(b)])\n\ta = '0' * (d - len(a)) + a\n\tb = '0' * (d - len(b)) + b\n\n\tans = \"\"\n\tcarry = 0\n\tfor i in range(d):\n\t\ts = int(a[-i-1]) + int(b[-i-1]) + carry\n\t\tcarry = s // 10\n\t\tans = str(s % 10) + ans\n\telse:\n\t\tif carry:\n\t\t\tans = str(carry) + ans\n\n\treturn ans\n\n# calculate a - b\n# a, b: int or string\ndef bigint_minus(a, b): \n\ta = str(a)\n\tb = str(b)\n\tM = []\n\tm = []\n\tsign = \"\"\n\n\tif len(a) > len(b) or (len(a) == len(b) and a >= b):\n\t\t[M, m] = [a, b]\n\telse:\n\t\t[M, m] = [b, a]\n\t\tsign = \"-\"\n\tm = '0' * (len(M) - len(m)) + m\n\n\tans = \"\"\n\tborrow = 0\n\tfor i in range(len(M)):\n\t\ts = int(M[-i-1]) - int(m[-i-1]) - borrow\n\t\tif s < 0:\n\t\t\tborrow = 1\n\t\t\ts += 10\n\t\telse:\n\t\t\tborrow = 0\n\t\tans = str(s) + ans\n\n\treturn sign + delete_head_zeros(ans)\n\n# calculate a * b\n# a, b: int or string\ndef bigint_multiply(a, b):\n\ta = str(a)\n\tb = str(b)\n\n\tmd = []\n\tfor j in range(len(b)):\n\t\tcarry = 0\n\t\tmj = \"\"\n\t\tfor i in range(len(a)):\n\t\t\tm = int(a[-i-1]) * int(b[-j-1]) + carry\n\t\t\tcarry = m // 10\n\t\t\tmj = str(m % 10) + mj\n\t\telse:\n\t\t\tif carry:\n\t\t\t\tmj = str(carry) + mj\n\t\tmd.append(mj)\n\n\tans = 0\n\tfor k in range(len(md)):\n\t\tans = bigint_plus(md[k] + \"0\" * k, ans)\n\n\treturn ans\n\n# calculate a / b to d digits after decimal point\n# a, b, d: int or string\ndef bigint_divide(a, b, d = 0):\n\ta = str(a)\n\tb = str(b)\n\td = int(d)\n\tif d < 0:\n\t\td = 0\n\n\tans = \"\"\n\tr = \"\"\n\tfor i in range(len(a) + d):\n\t\tq = 0\n\t\tif i < len(a):\n\t\t\tr += a[i]\n\t\telif i == len(a):\n\t\t\tans += \".\"\n\t\t\tr += \"0\"\n\t\telse:\n\t\t\tr += \"0\"\n\n\t\tif bigint_compare(r, b) == -1:\n\t\t\tans += str(q)\n\t\telse:\n\t\t\twhile bigint_compare(r, b) >= 0:\n\t\t\t\tr = bigint_minus(r, b)\n\t\t\t\tq += 1\n\t\t\tans += str(q)\n\n\treturn delete_head_zeros(ans)\n\ndef gcd(a, b):\n\tif bigint_compare(a, b) >= 0:\n\t\tM = a\n\t\tm = b\n\telse:\n\t\tM = b\n\t\tm = a\n\tif m == \"0\":\n\t\treturn M\n\telse:\n\t\tq = bigint_divide(M, m)\n\t\tr = bigint_minus(M, bigint_multiply(m, q))\n\t\treturn gcd(m, r)\n\ndef lcm(a, b):\n\treturn bigint_divide(bigint_multiply(a, b), gcd(a, b))\n\ndef main():\n\tN = int(input())\n\tT = [input() for i in range(N)]\n\tans = 1\n\tfor i in range(len(T)):\n\t\tans = lcm(T[i], ans)\n\n\tprint(ans)\n\nmain()", "import numpy as np\nwith open(0) as f:\n    N, *T = map(int, f.read().split())\nans = 1\nfor t in T:\n    ans = np.lcm(ans, t)\nprint(ans)", "# ==================================================-\n# \u6700\u5927\u516c\u7d04\u6570n\u500b\ndef euclid(a, b):\n    if b == 0:\n        return a\n    else:\n        return euclid(b, a % b)\n\n\ndef multiple(a, b):\n    return a * b // euclid(a, b)\n\n\nimport functools\n\n\n# ------\u30e1\u30a4\u30f3\u95a2\u6570-------\n# nums\u306f\u6574\u6570\u306e\u30ea\u30b9\u30c8\ndef lcm(nums):\n    return functools.reduce(multiple, nums)\n\na=[]\n\nn=int(input())\nfor i in range(n):\n    a.append(int(input()))\n\nprint(lcm(a))", "import math\nfrom functools import reduce\n\nn = int(input())\nt = [int(input()) for _ in range(n)]\n\ndef lcm(a,b):\n    return a*b//math.gcd(a,b)\n\nprint(reduce(lcm, t))", "from math import gcd\nfrom functools import reduce\n\n\ndef lcm(a, b):\n    return (a * b) // gcd(a, b)\n\n\ndef main():\n    n = int(input())\n    t = [int(input()) for _ in range(n)]\n    print((reduce(lcm, t)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 26 22:43:32 2020\n\n@author: liang\n\"\"\"\n\nfrom math import gcd\n\nN = int(input())\nT = [int(input()) for i in range(N)]\nans = 1\n\nfor i in range(N):\n    ans = ans*T[i]//gcd(ans,T[i])\n\nprint(ans)", "N = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef gcd(a, b):\n    if a % b == 0:\n        return b\n    else:\n        return gcd(b, a%b)\n\n\ndef lcm(a, b):\n    return a*b // gcd(a, b)\n\n\nans = 1\nfor t in T:\n    ans = lcm(ans, t)\nprint(ans)\n", "import math\nN = int(input())\nans = 1\nfor i in range(N):\n  a = int(input())\n  ans = ans*a//math.gcd(ans,a)\nprint(ans)", "import math\nimport functools\ndef lcm(x,y):\n    return (x*y)//math.gcd(x,y)\nn = int(input())\nt = [int(input()) for i in range(n)]\na = functools.reduce(math.gcd,t)\nprint(functools.reduce(lcm,t))", "def gcd(a,b):\n    while b:\n        a,b=b,a%b\n    return a\n\ndef lcm(a,b):\n    return a*b//gcd(a,b)\n      \nN=int(input())\nT=[]\ntotal=1\nfor i in range(N):\n    a=int(input())\n    T.append(a)\nT_set=sorted(list(set(T)))\nM=len(T_set)\n\nans=T_set[0]\nif M==1:\n    ans=T_set[0]\nelse:\n    for i in range(1,M):\n        ans=lcm(ans,T_set[i])\n\nprint(ans)", "def main():\n    def gcd(a,b):\n        while b!=0:\n            a, b = b, a%b\n        return a\n\n    def lcm(a,b):\n        return a*b // gcd(a,b)\n\n    N = int(input())\n    T = [int(input()) for _ in range(N)]\n    ans = 1\n    for t in T:\n        ans = lcm(ans, t)\n    print(ans)\n\ndef __starting_point():\n    main()\n\n__starting_point()", "import math\nn=int(input())\nt=[int(input()) for i in range(n)]\nres=t[0]\nfor i in range(1,n):\n  res=res*t[i]//math.gcd(res,t[i])\nprint(res)", "from math import gcd\nfrom functools import reduce\n\ndef lcm(x, y):\n  return (x*y) // gcd(x, y)\n\nN = int(input())\nTS = [int(input()) for _ in range(N)]\n\nprint((reduce(lcm, TS)))\n", "import math\nn=int(input())\nt=[int(input()) for i in range(n)]\nres=t[0]\nfor i in range(1,n):\n  res=res*t[i]//math.gcd(res,t[i])\nprint(res)", "import math\ndef lcm(x,y):\n    return (x*y)//(math.gcd(x,y))\n\nn=int(input())\nt=[int(input()) for _ in range(n)]\nans=1\nfor i in t:\n    ans=lcm(i,ans)\nprint(ans)", "from math import gcd\nN = int(input())\ndef lcm(a,b):\n    return a*b//gcd(a,b)\n\nT1 = int(input())\nans = T1\nfor i in range(N-1):\n    T2 = int(input())\n    ans = lcm(ans,T2)\n    T1 = T2\n\nprint(ans)", "import math\nfrom functools import reduce\n\n\nn = int(input())\ntt = [int(input()) for i in range(n)]\n\nx = 1\n\ndef lcm_base(x,y):\n  return (x*y) // math.gcd(x,y)\ndef lcm(*numbers):\n  return reduce(lcm_base, numbers, 1)\n\nprint(lcm(*tt))", "N = int(input())\nti = [int(input()) for i in range(N)]\n\n\ndef euc_alg(val1, val2):\n\n    if val1 == val2:\n        return val1\n\n    mod = min(val1, val2)\n    divided = max(val1, val2)\n    while 1:\n        tmp_mod = divided % mod\n\n        if tmp_mod == 0:\n            break\n        divided = mod\n        mod = tmp_mod\n\n    ret = val1 * val2 // mod\n\n    return ret\n\nmaxti = max(ti)\n# least_common_mult = max([euc_alg(maxti, t) for t in ti])\n\nans = ti[0]\nfor t in ti:\n    ans = euc_alg(ans, t)\n\nprint(ans)\n", "import math\n        \nN = int(input())\nT = []\nfor i in range(N):\n    T.append(int(input()))\nans = T[0]\n\nfor i in range(1, N):\n    ans = ans * T[i] // math.gcd(ans, T[i])\n\nprint(ans)\n    \n\n", "def gcd(a,b):\n    while b!=0:\n        a, b = b, a%b\n    return a\n\ndef lcm(a,b):\n    return a*b // gcd(a,b)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = 1\nfor t in T:\n    ans = lcm(ans, t)\nprint(ans)\n", "n=int(input())\nimport math\nans=1\nfor i in range(n):\n    t=int(input())\n    ans=(ans//math.gcd(ans,t))*t\n    \nprint(ans)\n", "import math\n\nN = int(input())\n\ndef lcm(x, y):\n  return (x*y) // math.gcd(x, y)\n\nans = 1\n\nfor _ in range(N):\n  T = int(input())\n  ans = lcm(ans, T)\n\nprint(ans)", "import math\n\n\ndef lcm(x, y):\n    return x * y // math.gcd(x, y)\n\n\ndef main():\n    n = int(input())\n    t_lst = [int(input()) for _ in range(n)]\n    t_lst.sort()\n    answer = t_lst[0]\n    for i in range(1, n):\n        t = t_lst[i]\n        answer = lcm(answer, t)\n\n    print(answer)\n\n\ndef __starting_point():\n    main()\n__starting_point()", "N=int(input())\nT=list(int(input()) for _ in range(N))\n\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a%b\n\treturn a\n\nans=T[0]\nfor i in range(1, N):\n\tans=ans*T[i]//gcd(ans, T[i])\nprint(ans)", "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\n\ndef main():\n    n = i_input()\n    t = i_input()\n    for i in range(n-1):\n        k = i_input()\n        t = t*k//gcd(t,k)\n    print(t)\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "def gcd(a, b):\n    if b == 0:\n        return a\n    return gcd(b, a % b)\n\ndef lcm(a, b):\n    g = gcd(a, b)\n    return a // g * b\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\nans = 1\n\nfor i in range(N):\n    ans = lcm(ans, T[i])\n\nprint(ans)", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm_list(list):\n    return reduce(lcm_base, list, 1)\n\nN = int(input())\nT = [int(input()) for i in range(N)]\n\nprint((lcm_list(T)))\n", "from math import *\n\ndef lcm(x,y):\n  return (x*y)//gcd(x,y)\n\nN=int(input())\nT=[int(input()) for _ in range(N)]\nans=T[0]\nfor i in range(1,N):\n  ans=lcm(ans,T[i])\nprint(ans)\n", "from math import gcd\n\nn = int(input())\nans = 1\nfor _ in range(n):\n    t = int(input())\n    ans = ans * t // gcd(ans, t)\nprint(ans)", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nn = int(input())\n\nl = []\n\nfor i in range(n):\n    t = int(input())\n    l.append(t)\n\nprint((lcm_list(l)))\n", "import math\nfrom functools import reduce\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nprint(lcm_list(T))", "n = int(input())\nt = [int(input()) for _ in range(n)]\n\nimport math\n\ndef lcm(x,y):\n    return (x * y) // math.gcd(x, y)\n\nans = 1\nfor i in range(n):\n    ans = lcm(ans,t[i])\nprint(ans)", "#\n# abc070 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\nimport math\nfrom functools import reduce\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"2\n2\n3\"\"\"\n        output = \"\"\"6\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"5\n2\n5\n10\n1000000000000000000\n1000000000000000000\"\"\"\n        output = \"\"\"1000000000000000000\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    N = int(input())\n    T = [int(input()) for _ in range(N)]\n\n    print((lcmlist(T)))\n\n\ndef lcm(x, y):\n    return (x * y) // math.gcd(x, y)\n\n\ndef lcmlist(l):\n    return reduce(lcm, l)\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "n = int(input())\nT = [int(input()) for _ in range(n)]\n\ndef gcd(a, b):\n  if a > b:\n    a, b = b, a\n  while a % b != 0:\n    a, b = b, a % b\n  return b\n\ndef lcm(a, b):\n  return a * b // gcd(a, b)\n\nl = T.pop()\nfor t in T:\n  l = lcm(l, t)\nprint(l)", "from math import gcd\nn = int(input())\nans = int(input())\nfor _ in range(n - 1):\n    t = int(input())\n    ans = (ans * t) // gcd(ans, t)\n\nprint(ans)\n", "N=int(input())\nT=[int(input()) for _ in range(N)]\n\ndef gcd(a,b):\n    l=max(a,b)\n    s=min(a,b)\n    while True:\n        x=s\n        y=l%s\n        if y==0:\n            break\n        else:\n            l=x\n            s=y\n    return s\nif N!=1:\n  ans=T[0]*T[1]//gcd(T[0],T[1])\n  for n in range(1,N):\n    ans=ans*T[n]//gcd(ans,T[n])\nelse:\n  ans=T[0]\n\nprint(ans)            \n", "def gcd(x, y):\n    if(y == 0):\n        return x\n        \n    return gcd(y, x%y)\n    \ndef lcm(x, y):\n    return (x*y)//(gcd(x, y))\n\n\nn = int(input())\nx = []\nfor i in range(n):\n    x.append(int(input()))\n        \nl = x[0]\nfor i in range(1, n):\n    l = lcm(l, x[i])\n        \nprint(l)", "from math import gcd\nfrom functools import reduce\n\n\ndef lcm(a, b):\n    return (a * b) // gcd(a, b)\n\n\ndef main():\n    n = int(input())\n    t = {int(input()) for _ in range(n)}\n    print((reduce(lcm, t)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "import math\n\nN = int(input())\nT = [int(input())for _ in range(N)]\n\nans = T[0]\n\nfor i in range(1,N):\n    ans = (ans*T[i])//math.gcd(ans,T[i])\n    #ans %= 10**18+7\nprint(ans)\n    \n", "from math import gcd\n\nn = int(input())\nT = [int(input()) for _ in range(n)]\n\nans = 1\nfor i in range(n):\n    ans = ans * T[i] // gcd(ans, T[i])\nprint(ans)", "import math\ndef lcm(a, b): return a * b // math.gcd(a, b)\n\nn = int(input())\n\nif n == 1:\n    print(input())\n\nelif n == 2:\n    a = int(input())\n    b = int(input())\n    print(lcm(a,b))\nelse:\n    a = int(input())\n    b = int(input())\n    ans = lcm(a,b)\n    for _ in range(n-2):\n        i = int(input())\n        ans = lcm(ans, i)\n    print(ans)", "N = int(input())\nT = []\n\nfor i in range(N):\n  T.append(int(input()))\n\nimport math\n\ndef lcm(m,n):\n  return (m*n)//math.gcd(m,n)\n\ndef lcm_list(nums):\n  lcm_num = nums[0]\n  for i in range(1,len(nums)):\n    lcm_num = lcm(lcm_num,nums[i])\n  return lcm_num\n\nprint(lcm_list(T))", "import math\n\nn = int(input())\na = []  \nfor i in range(n):\n  a.append(int(input()))\nif n == 1:\n  print((a[0]))\nelse:\n  lcm = (a[0] * a[1]) // math.gcd(a[0], a[1])\n  for i in range(2, n):\n    lcm = (lcm * a[i]) // math.gcd(lcm, a[i])\n  print(lcm)\n", "import math\n\nn = int(input())\nans = 1\nfor _ in range(n):\n    t1 = int(input())\n    ans = ans//math.gcd(ans, t1)*t1\n\nprint(ans)", "n= int(input())\na=int(input())\n\nimport math\nif n==1:\n\tprint(a)\n\treturn\n\nb=int(input())\nc=(a*b)//math.gcd(a,b)\nfor i in range(n-2):\n\tb=int(input())\n\tc=(c*b)//math.gcd(c,b)\n\nprint(c)", "import math\nN = int(input())\nans = 0\nfor i in range(N):\n  if i == 0:\n    ans = int(input())\n  else:\n    a = int(input())\n    ans = (a * ans) // math.gcd(ans,a)\nprint(ans)\n", "def gcd(a,b):\n    while b!=0:\n        tmp = b\n        b = a%b\n        a = tmp\n    return a\n\ndef lcm(a,b):\n    return a*b // gcd(a,b)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = 1\nfor t in T:\n    ans = lcm(ans, t)\nprint(ans)\n", "import math\nN = int(input())\nlsT = []\nfor i in range(N):\n    lsT.append(int(input()))\na = lsT[0]\nfor b in range(1,N):\n    a = a*lsT[b] // math.gcd(a,lsT[b])\nprint(a)", "import math\n\nn = int(input())\ntL = [int(input()) for _ in range(n)]\n\n\ndef lcm(x, y):\n    return (x * y) // math.gcd(x, y)\n\n\nans = tL[0]\nfor t in tL[1:]:\n    ans = lcm(t, ans)\n\nprint(ans)", "n=int(input())\nA=[]\nfor i in range(n):\n    A.append(int(input()))\n\nimport numpy as np\nprint(np.lcm.reduce(A))", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm(*numbers):\n    return reduce(lcm_base, numbers, 1)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base, numbers, 1)\nN = int(input())\nAA = [int(input()) for i in range(N)]\nprint(lcm(*AA))", "n = int(input())\na = []\nfor i in range(n):\n  a.append(int(input()))\n\ndef gcd(x,y):\n  while y != 0:\n    x, y = y, x % y\n  return x\n\nres = a[0]\nfor i in range(n):\n  res = (res*a[i]) // gcd(res,a[i])\n\nprint(res)", "from math import gcd\nn = int(input())\nT = []\nfor i in range(n):\n    T.append(int(input()))\n\ntmp = T[0]\nfor i in range(1,n):\n    g = gcd(tmp,T[i])\n    tmp = T[i]*tmp//g\n    \nprint(tmp)", "N = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef gcd(a,b):\n    if a % b == 0:\n        return b\n    return gcd(b, a%b)\n\nres = T[0]\nfor t in T:\n    gcd_ = gcd(res, t)\n    res = res*t//gcd_\nprint(res)\n", "#\u6700\u5927\u516c\u7d04\u6570\ndef gcd(a,b):\n  if b==0:\n    return a\n  else:\n    return gcd(b,a%b)\n\n#\u6700\u5c0f\u516c\u500d\u6570\ndef lcm(a,b):\n  return a*b//gcd(a,b)\n\n#\u5168\u3066\u306e\u6700\u5c0f\u516c\u500d\u6570\u3092\u6c42\u3081\u308c\u3070\u3044\u3044\nn=int(input())\nans=1\nfor i in range(n):\n  ans=lcm(ans,int(input()))\nprint(ans)\n\n  \n\n\n\n", "n = int(input())\nfrom fractions import gcd\ng = int(input())\nfor i in range(n-1):\n  h = int(input())\n  g = g * h // gcd(g,h)\nprint(g)", "from math import gcd\nn = int(input())\nt = [int(input()) for i in range(n)]\nans = 1\nfor i in range(n):\n    ans = ans*t[i]//gcd(ans, t[i])\nprint(ans)", "import math\n\nn = int(input())\nans = 1\nfor _ in range(n):\n    t = int(input())\n    ans = ans * t // math.gcd(ans, t)\nprint(ans)", "import math\nfrom functools import reduce\n\ndef lcm_base(x, y):\n    return (x * y) // math.gcd(x, y)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nN = int(input())\nN_List = []\nfor i in range(N):\n    N_List.append(int(input()))\n\nprint((lcm_list(N_List)))\n", "import math\n\nn = int(input())\ntl = [int(input()) for _ in range(n)]\n\nif n == 1:\n    print((tl[0]))\nelse:\n    g = tl[0] // math.gcd(tl[0], tl[1]) * tl[1]\n    for i in range(1, n):\n        g = g // math.gcd(g, tl[i]) * tl[i]\n    print(g)\n", "import math\n\nn = int(input())\nt = [int(input()) for _ in range(n)]\n\nans = 1\nfor i in t:\n    ans = ans*i // math.gcd(ans, i)\nprint(ans)", "import math\nn = int(input())\nT = [int(input()) for _ in range(n)]\n\n#\u6700\u5c0f\u516c\u500d\u6570\ndef lcm(x, y):\n    return (x*y)//math.gcd(x, y)\n\nans = T[0]\nfor t in T[1:]:\n    ans = lcm(ans, t)\nprint(ans)", "n=int(input())\n\nimport math\nfrom functools import reduce\ndef lcm_base(x, y):# \u6700\u5c0f\u516c\u500d\u6570\n    return (x * y) // math.gcd(x, y)\ndef lcm(numbers):\n    return reduce(lcm_base, numbers, 1)\n\nt=[]\nfor i in range(n):\n    t.append(int(input()))\n\nprint(lcm(t))", "#70\nfrom math import gcd\nn=int(input())\nt=[int(input()) for i in range(n)]\n\nans=1\nfor i in range(n):\n    ans*=t[i]//gcd(ans,t[i])\nprint(ans)\n", "import math\n\na = 1\nn = int(input())\nfor i in range(n):\n  t = int(input())\n  a = (a * t) // math.gcd(a, t)\nprint(a)", "#from statistics import median\n#import collections\n#aa = collections.Counter(a) # list to list || .most_common(2)\u3067\u6700\u5927\u306e2\u500b\u3068\u308a\u3060\u305b\u308b\u304a a[0][0]\nfrom math import gcd\nfrom itertools import combinations,permutations,accumulate, product # (string,3) 3\u56de\n#from collections import deque\nfrom collections import deque,defaultdict,Counter\nimport decimal\nimport re\nimport math\nimport bisect\nimport heapq\n#\n#\n#\n# python\u3067\u7121\u7406\u306a\u3068\u304d\u306f\u3001pypy\u3067\u3084\u308b\u3068\u6b63\u89e3\u3059\u308b\u304b\u3082\uff01\uff01\n#\n#\n# my_round_int = lambda x:np.round((x*2 + 1)//2)\n# \u56db\u6368\u4e94\u5165g\n#\n# \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7cfb\n# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);\n# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);\n#\n#\nimport sys\nsys.setrecursionlimit(10000000)\n# mod = 10**9 + 7\n#mod = 9982443453\nmod = 998244353\nINF = float('inf')\nfrom sys import stdin\nreadline = stdin.readline\ndef readInts():\n  return list(map(int,readline().split()))\ndef readTuples():\n    return tuple(map(int,readline().split()))\ndef I():\n    return int(readline())\nn = I()\ng = 0\nlcm = 1\nfor i in range(n):\n    A = I()\n    g = math.gcd(A,g)\n    if i == 0:\n        lcm = A\n    else:\n        lcm = (lcm*A)//g\n    g = lcm\nprint(lcm)\n", "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC\n# CreatedDate:  2020-09-04 15:32:03 +0900\n# LastModified: 2020-09-04 15:43:28 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n# import pandas as pd\n\n\ndef gcd(a, b):\n    while a % b != 0:\n        r = a % b\n        a = b\n        b = r\n    return b\n\n\ndef main():\n    n = int(input())\n    ans = int(input())\n    for _ in range(n-1):\n        t = int(input())\n        ans = ans*t//gcd(max(ans, t), min(ans, t))\n    print(ans)\n\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "N = int(input())\nT = [int(input()) for i in range(N)]\nimport math\na = T[0]\nfor i in range(1,N):\n    a = (a*T[i]) // math.gcd(a,T[i])\nprint(a)", "# C - Multiple Clocks\nimport functools\nimport math\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef lcm(a,b):\n    LCM = a*b//math.gcd(a,b)\n    return LCM\n\ndef all_lcm(A):\n    ans = functools.reduce(lcm,A,1)\n    return ans\n\nprint(all_lcm(T))", "import math\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef lcm(a, b):\n    return a*b // math.gcd(a, b)\n\nans = T[0]\nfor i in range(1, N):\n    ans = lcm(ans, T[i])\nprint(ans)\n", "def gcd(m, n):\n    if m < n:\n        m, n = n, m\n\n    while True:\n        r = m % n\n        if r == 0:\n            return n\n        else:\n            m, n = n, r\n\ndef lcm(m, n):\n    return m*n // gcd(m, n)\n\nn = int(input())\nl = []\n\nans = 1\n\nfor i in range(n):\n    t = int(input())\n    ans = lcm(ans, t)\n\nprint(ans)\n", "import math\nfrom functools import reduce\n\ndef lcm_base(x,y):\n    return (x*y)//math.gcd(x,y)\n\ndef lcm_list(numbers):\n    return reduce(lcm_base,numbers,1)\n\nn=int(input())\nnums=[int(input()) for i in range(n)]\n\nprint((lcm_list(nums)))\n", "def lcm(a):\n    import math\n    x = a[0]\n    for i in range(1, len(a)):\n        x = (x * a[i]) // math.gcd(x, a[i])\n    return x\n\n\ndef resolve():\n    N = int(input())\n    T = [int(input()) for _ in range(N)]\n    print((lcm(T)))\n\n\nresolve()\n", "from math import gcd\nn = int(input())\na = 1\nfor _ in range(n):\n  x = int(input())\n  a = a // gcd(a, x) * x\nprint(a)", "from math import gcd\n\nn = int(input())\ng = int(input())\n\nfor i in range(n-1):\n    t = int(input())\n    g = g * t // gcd(g, t)\n\nprint(g)\n"]


Question:
Victor tries to write his own text editor, with word correction included. However, the rules of word correction are really strange.

Victor thinks that if a word contains two consecutive vowels, then it's kinda weird and it needs to be replaced. So the word corrector works in such a way: as long as there are two consecutive vowels in the word, it deletes the first vowel in a word such that there is another vowel right before it. If there are no two consecutive vowels in the word, it is considered to be correct.

Victor also thinks consecutive copies of the same letter (for example, "bb") are unpleasant.

You are given a word s. Can you predict what will it become after correction?

In this problem letters a, e, i, o, u and y are considered to be vowels.

-----Input-----

The first line contains one integer n (1 ≤ n ≤ 100) — the number of letters in word s before the correction.

The second line contains a string s consisting of exactly n lowercase Latin letters — the word before the correction.

-----Output-----

Output the word s after the correction.

-----Examples-----
Input
5
weird

Output
werd

Input
4
word

Output
word

Input
5
aaeaa

Output
a

-----Note-----

Explanations of the examples:  There is only one replace: weird $\rightarrow$ werd; No replace needed since there are no two consecutive vowels; aaeaa $\rightarrow$ aeaa $\rightarrow$ aaa $\rightarrow$ aa $\rightarrow$ a.

["n = int(input())\ns = input()\nt = []\nvowels = 'aeiouy'\nfor c in s:\n    if t and t[-1] in vowels and c in vowels:\n        continue\n    else:\n        t.append(c)\nprint(''.join(t))\n", "n=int(input())\ns=list(input())\nel=0\nwhile el+1<len(s):\n    if s[el] in 'aeiouy' and s[el+1] in \"aeiouy\":\n        del s[el+1]\n    else:\n        el+=1\nprint(''.join(s))", "n = input()\ns = input()\n\nres = ''\nv = False\nfor c in s:\n    if c in 'aeiouy' and not v:\n        v = True\n        res += c\n    if c not in 'aeiouy':\n        if v:\n            v = False\n        res += c\n\nprint(res)\n", "n = int(input())\ns = input()\ni = 0\nwhile i < len(s):\n\tif i < len(s) - 1 and s[i + 1] in 'aeyuio' and s[i] in 'aeyuio':\n\t\ts = s[:i + 1] + s[i + 2:]\n\t\ti -= 1\n\ti += 1\nprint(s)", "n = int(input())\ns = input()\nvowel = \"aeiouy\"\nfirst = 0\nfor x in s:\n\tif x in vowel and not first:\n\t\tfirst = 1\n\t\tprint(x, end=\"\")\n\telif x not in vowel:\n\t\tfirst = 0\n\t\tprint(x, end=\"\")\nprint()\n", "input()\ns = input()\ng = {'a','e','o','i','u','y'}\ndone = False\nwhile not done:\n    done = True\n    for i in range(1, len(s)):\n        if s[i] in g and s[i-1] in g:\n            done = False\n            s = s[:i] + s[i+1:]\n            break\nprint(s)", "n = int(input())\ns = list(input())\nglas = list('aoiyue')\nf = 1\nwhile f:\n    f = 0\n    for i in range(1, len(s)):\n        if s[i] in glas and s[i - 1] in glas:\n            f = 1\n            s = s[:i] + s[i + 1:]\n            break\nprint(''.join(s))", "d = {'a', 'e', 'i', 'o', 'u', 'y'}\n\nn = int(input())\ns = list(input())\n\nfound = -1\nwhile 1:\n    found = -1\n    for i in range(len(s) - 1):\n        if s[i] in d and s[i + 1] in d:\n            found = i + 1\n            break\n    if (found == -1):\n        break\n    s.pop(found)\nprint(*s, sep=\"\")", "n = int(input())\ncheck = ['a', 'e', 'i', 'o', 'u', 'y']\na = input()\ni = 1\nwhile (i < len(a)):\n    if a[i] in check and a[i - 1] in check:\n        a = a[:i] + a[i + 1:]\n    else:\n        i += 1\nprint(a)", "n = int(input())\ns = input()\ngl = \"aeiouy\"\nt=True\nfor i in range(n):\n    if s[i] not in gl:\n        print(s[i],end=\"\")\n        t = True\n    elif t:\n        print(s[i],end=\"\")\n        t = False", "input()\ns = list(input())\n\ndef isGlasnaya(char):\n    return char in ['a', 'e', 'i', 'o', 'u', 'y']\n\ni = 0\nwhile i + 1 < len(s):\n    if isGlasnaya(s[i]) and isGlasnaya(s[i + 1]):\n        del s[i + 1]\n        i = 0\n    else:\n        i += 1\nprint(''.join(s))\n", "v = 'aiouey'\nn = int(input())\ns= input()\no =s[0]\nfor i in range(1,n):\n    if (s[i] in v):\n        if s[i-1] not in v:o+=s[i]\n    else:o+=s[i]\nprint(o)\n", "n = input()\ns = input()\nbad = \"aeiouy\"\nwhile True:\n    ok = True\n    for i in range(1, len(s)):\n        if (s[i] in bad) and (s[i-1] in bad):\n            s = s[:i] + s[i+1:]\n            ok = False\n            break\n    if(ok):\n        print(s)\n        break\n            \n", "b = \"aeiouy\"\nn = int(input())\ns = input()\na = [0] * len(s)\nfor i in range(1, len(s)):\n    if s[i - 1] in b and s[i] in b:\n        a[i] = 1\nfor i in  range(len(s)):\n    if not a[i]:\n        print(s[i], end=\"\")\n        ", "b = input()\na = input()\nc = []\ng = 'aeiouy'\nc.append(a[0])\nfor i in range(len(a)-1):\n    if a[i] in g and a[i+1] in g:\n        pass\n    else:\n        c.append(a[i+1])\n\n\n\nprint(''.join(c))\n\n", "n = input()\ns = input()\nv = 'euoaiy'\ni = 1\nwhile True:\n    if i >= len(s):\n        break\n    if s[i] in v and s[i - 1] in v:\n        s = s[:i] + s[i + 1:]\n    else:\n        i += 1\n\nprint(s)\n", "n = int(input())\ns = list(input())\ngl = ['a', 'e', 'i', 'o', 'u', 'y']\nx = -1\nuber = []\nk = 0\nfor i in range(n - 1):\n    if s[i] in gl and s[i + 1] in gl:\n        uber.append(i + 1)\nfor i in uber:\n    s.pop(i - k)\n    k += 1\nprint(''.join(s))", "v = 'aeiouy'\nn = input()\na = input()\ni = 0\ntry:\n    while i < len(a):\n        while a[i] in v and a[i+1] in v:\n            a = a[:i+1] + a[i+2:]\n        i += 1\nexcept:\n    pass\nprint(a)\n", "import sys\n\ndef is_vowel(c):\n    return c in set(\"aeiouy\")\n\ndef main():\n    _ = input()\n    s = input()\n    \n    for _ in range(len(s)):\n        for i in range(len(s) - 1):\n            if is_vowel(s[i]) and is_vowel(s[i + 1]):\n                s = s[:(i + 1)] + s[(i+2):]\n                break\n    \n    print(s)\n    \ndef __starting_point():\n    main()\n\n__starting_point()", "import math as mt\nimport itertools as it\nimport functools as ft\n\nstdin = lambda type_ = \"int\", sep = \" \": list(map(eval(type_), input().split(sep)))\njoint = lambda sep = \" \", *args: sep.join(str(i) if type(i) != list else sep.join(map(str, i)) for i in args)\n\nn = int(input())\ns = input()\n\ni = 0\nwhile i < len(s) - 1:\n    if s[i] in \"aeoiuy\" and s[i + 1] in \"aeiouy\":\n        s = s[:i + 1] + s[i + 2:]\n        i -= 1\n    i += 1\n\nprint(s)", "def main():\n    n = input()\n    s = input()\n    \n    a= []\n    for x in s:\n        if x in 'aeiouy':\n            if len(a)>0 and a[-1] in 'aeiouy':\n                continue\n            else:\n                a.append(x)\n        else:\n            a.append(x)\n            \n    print(''.join(a))\n\n    \ndef __starting_point():\n    main()\n\n__starting_point()", "n = input()\nword = input().strip()\n\ndef is_vowel(ch):\n  return ch in ['a', 'e', 'i', 'o', 'u', 'y']\n\nres = [word[0]]\nfor i in range(1, len(word)):\n  if is_vowel(word[i]):\n    if not is_vowel(word[i-1]):\n      res.append(word[i])\n  else:\n    res.append(word[i])\n\nprint(''.join(res))\n", "def vowel(t):\n    if t == 'a' or t == 'e' or t == 'i' or t == 'o' or t == 'u' or t == 'y':\n        return True\n    else:\n        return False\nn = int(input())\ns = input()\ncur = 1\nvow = vowel(s[0])\nwhile cur < len(s):\n    preVow = vow\n    vow = vowel(s[cur])\n    if preVow and vow:\n        s = s[:cur] + s[cur+1:]\n    else:\n        cur += 1\n\nprint(s)\n", "n = int(input())\n\nw = ['a', 'e', 'i', 'o', 'u', 'y']\nres = []\n\nfor c in input():\n    if len(res) == 0:\n        res.append(c)\n        continue\n    if c in w:\n        if res[-1] in w:\n            continue\n    res.append(c)\n\nprint(''.join(res))\n", "def ii():\n    return int(input())\ndef mi():\n    return map(int, input().split())\ndef li():\n    return list(mi())\n\nn = ii()\ns = input().strip()\nt = []\nv = 'aeiouy'\ni = 0\nwhile i < n:\n    t += [s[i]]\n    if s[i] not in v:\n        i += 1\n        continue\n    j = i + 1\n    while j < n and s[j] in v:\n        j += 1\n    i = j\nprint(''.join(t))"]

{
  "inputs": [
    "5\nweird\n",
    "4\nword\n",
    "5\naaeaa\n",
    "100\naaaaabbbbboyoyoyoyoyacadabbbbbiuiufgiuiuaahjabbbklboyoyoyoyoyaaaaabbbbbiuiuiuiuiuaaaaabbbbbeyiyuyzyw\n",
    "69\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "12\nmmmmmmmmmmmm\n",
    "18\nyaywptqwuyiqypwoyw\n",
    "85\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "13\nmmmmmmmmmmmmm\n",
    "10\nmmmmmmmmmm\n",
    "11\nmmmmmmmmmmm\n",
    "15\nmmmmmmmmmmmmmmm\n",
    "1\na\n",
    "14\nmmmmmmmmmmmmmm\n",
    "33\nmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\n",
    "79\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "90\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "2\naa\n",
    "18\niuiuqpyyaoaetiwliu\n",
    "5\nxxxxx\n",
    "6\nxxxahg\n",
    "3\nzcv\n",
    "4\naepo\n",
    "5\nqqqqq\n",
    "6\naaaaaa\n",
    "4\naeta\n",
    "20\nttyttlwaoieulyiluuri\n",
    "1\nb\n",
    "3\nanc\n",
    "1\ne\n",
    "3\naie\n",
    "3\nvio\n",
    "2\nea\n",
    "3\nuas\n",
    "2\nba\n",
    "2\naq\n",
    "2\nya\n",
    "2\nou\n",
    "2\nbb\n",
    "7\nayylmao\n",
    "2\nab\n",
    "19\nyuouiyaoiiweqrryqqp\n",
    "25\niqypwqpriiioetiuqqqttouei\n",
    "100\naaaaabbbbboyoyoyoyoyacadabbbbbiuiufgiuiuaahjabbbklboyoyoyoyoyaaaaabbbbbiuiuiuiuiuaaaaabbbbbeyiyuyzyz\n",
    "17\naccccccccccccccca\n",
    "5\nababa\n",
    "10\naaaaaaaaaa\n",
    "22\naaaaabbbbboyoyoyoyoyac\n",
    "7\nmahmoud\n"
  ],
  "outputs": [
    "werd\n",
    "word\n",
    "a\n",
    "abbbbbocadabbbbbifgihjabbbklbobbbbbibbbbbezyw\n",
    "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "mmmmmmmmmmmm\n",
    "ywptqwuqypwow\n",
    "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "mmmmmmmmmmmmm\n",
    "mmmmmmmmmm\n",
    "mmmmmmmmmmm\n",
    "mmmmmmmmmmmmmmm\n",
    "a\n",
    "mmmmmmmmmmmmmm\n",
    "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\n",
    "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n",
    "a\n",
    "iqpytiwli\n",
    "xxxxx\n",
    "xxxahg\n",
    "zcv\n",
    "apo\n",
    "qqqqq\n",
    "a\n",
    "ata\n",
    "ttyttlwalyluri\n",
    "b\n",
    "anc\n",
    "e\n",
    "a\n",
    "vi\n",
    "e\n",
    "us\n",
    "ba\n",
    "aq\n",
    "y\n",
    "o\n",
    "bb\n",
    "alma\n",
    "ab\n",
    "yweqrryqqp\n",
    "iqypwqpritiqqqtto\n",
    "abbbbbocadabbbbbifgihjabbbklbobbbbbibbbbbezyz\n",
    "accccccccccccccca\n",
    "ababa\n",
    "a\n",
    "abbbbboc\n",
    "mahmod\n"
  ]
}


Question:
Snuke is going to open a contest named "AtCoder s Contest".
Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
Snuke has decided to abbreviate the name of the contest as "AxC".
Here, x is the uppercase English letter at the beginning of s.
Snuke knows that the AIME exam instead abbreviates its exams "AyC," where y is the last letter of s.
Given the name of the contest, print the abbreviation of the name.

-----Constraints-----
 - The length of s is between 1 and 100, inclusive.
 - The first character in s is an uppercase English letter.
 - The second and subsequent characters in s are lowercase English letters.

-----Input-----
The input is given from Standard Input in the following format:
AtCoder s Contest

-----Output-----
Print the abbreviation of the name of the contest.

-----Sample Input-----
AtCoder Beginner Contest

-----Sample Output-----
ABC

The contest in which you are participating now.

["A,S,C=map(str,input().split())\nprint(\"A\"+S[0]+\"C\")", "s=input()\nprint(\"A\"+s[8]+\"C\")", "print(('A' + input().split()[1][0] + 'C'))\n", "a,b,c=map(str,input().split())\nprint('A'+b[0]+'C')", "lst = list(map(str, input().split()))\nprint(lst[0][0] + lst[1][0] + lst[2][0])", "arr = list(input().split())\nprint(arr[0][0] + arr[1][0] + arr[2][0])", "s = input().split()\nprint(\"A\" + s[1][0] + \"C\")", "s=input().split()\ns=[s[i][0] for i in range(len(s))]\nprint(\"\".join(s))", "x=input()\nprint((\"A\"+x[8]+\"C\"))\n", "S = input()\ns = 'A'+S[8].upper() + 'C'\nprint(s)", "s = input().split()\nprint('A'+ s[1][0].upper() +'C')", "a,b,c=input().split()\nprint(a[0]+b[0]+c[0])", "a=list(input().split())\nprint(a[0][0]+a[1][0]+a[2][0])", "a,b,c=map(str,input().split())\nprint(\"A\"+b[0]+\"C\")", "a, b, c = input().split()\n\nprint((a[0] + b[0] + c[0]))\n", "a,b,c = input().split()\n\nprint((a[0]+b[0]+c[0]).upper())", "from sys import stdin, stdout\nfrom time import perf_counter\n\nimport sys\nsys.setrecursionlimit(10**9)\nmod = 10**9+7\n\n# import sys\n# sys.stdout = open(\"e:/python/cp/output.txt\",\"w\")\n# sys.stdin = open(\"e:/python/cp/input.txt\",\"r\")\n\ns = input()\nprint(f\"A{s[8].upper()}C\")", "#!/usr/bin/env python3\n\ndef main():\n    a, s, c = input().split()\n    print((a[0] + s[0] + c[0]))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "s1, s2, s3 = input().split()\nprint((s1[0] + s2[0] + s3[0]))\n", "s = input().split()\nprint(s[0][0]+s[1][0]+s[2][0])", "print(f'A{input()[8]}C')", "a,s,c=input().split()\nprint(\"A\" + s[0].upper() + \"C\")", "a, b, c = input().split()\nprint(a[0] + b[0] + c[0])", "a,b,c=input().split()\nx=b[0]\nA=[]\nA.append('A')\nA.append(x)\nA.append('C')\nprint(''.join(A))", "s = list(map(str, input().split()))\n\nprint((s[0][0] + s[1][0] + s[2][0]))\n", "a, b, c = list(map(list, input().split()))\n\nprint(\"A\" + b[0] + \"C\")", "def solve():\n    print('A'+input()[8]+'C')\n\n\ndef __starting_point():\n    solve()\n__starting_point()", "a,b,c,=input().split()\nprint((a[0]+b[0]+c[0]))\n", "a,x,c = input().split()\n\nprint('A'+x[0]+'C')", "a,s,t = map(str,input().split())\nprint(\"A\"+s[0]+\"C\")", "a, b, c = list(map(str, input().split()))\nprint((a[0] + b[0] + c[0]))\n", "print(\"A\"+input()[8]+\"C\")", "s = input()\nprint((\"A\" + s[8] + \"C\"))\n", "l = list(input().split())\nprint(\"A\" + l[1][0] + \"C\")", "s = list(input().split())\nn = s[1]\nprint(\"A\" + n[0] + \"C\")", "s=input().split()\n\nprint((\"A\"+s[1][0]+\"C\"))\n", "from sys import stdin, stdout\nfrom time import perf_counter\n\nimport sys\nsys.setrecursionlimit(10**9)\nmod = 10**9+7\n\ns = input()\nprint(f\"A{s[8].upper()}C \")", "a = input().split()\nb=[]\n\nfor i in range(3):\n  b.append(a[i][0])\n  \nprint(b[0]+b[1]+b[2])", "a = list(map(str,input().split()))\nmidle = list(a[1])\nprint(\"A\"+midle[0]+\"C\")", "a,b,c=input().split()\nprint(a[0]+b[0]+c[0])", "A = list(map(str, input().split()))\nprint(A[0][0] + A[1][0] + A[2][0])", "a = input().split()\nprint(*[h[0] for h in a], sep='')\n", "a,s,c=map(str,input().split())\nprint((\"A\"+s[0]+\"C\"))", "s = input()\nprint((\"A\"+s[8]+\"C\"))\n", "a,b,c=input().split()\nprint(a[0]+b[0]+c[0])", "def iroha():\n    head, string, heel = list(map(str, input().split()))\n    headC = head[0]\n    Capital = string[0]\n    heelC = heel[0]\n    print((headC + Capital + heelC))\n\ndef __starting_point():\n    iroha()\n\n\n__starting_point()", "print(*[i[0] for i in input().split()],sep='')", "S = input()\nprint(\"A\"+S[8]+\"C\")", "s = input().split()[1]\nprint(\"A\"+s[0]+\"C\")", "a,b,c=input().split()\nprint('A'+b[0]+'C')", "#\n# abc048 a\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"AtCoder Beginner Contest\"\"\"\n        output = \"\"\"ABC\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"AtCoder Snuke Contest\"\"\"\n        output = \"\"\"ASC\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_3(self):\n        input = \"\"\"AtCoder X Contest\"\"\"\n        output = \"\"\"AXC\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    S = list(input().split())\n\n    print((\"A\"+S[1][0]+\"C\"))\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "s = input().split()\nprint(\"A\", s[1][0], \"C\", sep=\"\")\n", "a = list(input().split())\nprint(\"A\"+a[1][0]+\"C\")", "a, b, c = input().split()\n\nprint(('A' + b[0] + 'C'))\n", "\"\"\"\nABC048 A - AtCoder *** Contest\nhttps://atcoder.jp/contests/abc048/tasks/abc048_a\n\"\"\"\na,b,c = input().split()\nprint((a[0]+b[0]+c[0]))\n", "def __starting_point():\n\tstr = input()\n\ta,b,c = str.split()\n\tprint(a[0]+b[0]+c[0])\n__starting_point()", "print((\"\".join(s[0] for s in input().split())))\n", "x = input()[8]\nprint(\"A\"+x+\"C\")", "lst=input().split()\nx=lst[1]\nprint('A'+x[0]+'C')", "s = input()\nprint(\"A\" + s[8] + \"C\") ", "a,b,c =input().split()\nprint('A' + b[0] + 'C')", "names = input().split()\nprint(\"\".join([a[0] for a in names]))", "A,B,C=input().split()\nprint(\"A\"+B[0]+\"C\")", "S = input().split()\nprint(S[0][0]+S[1][0]+S[2][0])", "s = list(input().split())\nprint(\"A\" + s[1][0] + \"C\")", "print(f\"A%sC\"%input()[8])", "a,b,c = input().split()\n\nprint(a[0]+b[0]+c[0])", "print(''.join([s[0] for s in input().split()]))", "a = list(map(str, input().split()))\nprint(a[0][0] + a[1][0] + a[2][0])", "_, s, _ = input().split()\nprint((\"A\" + s[0] + \"C\"))\n", "a,s,c=map(str,input().split())\n\nprint('A'+s[0]+'C')", "a,b,c=list(map(str,input().split()))\nprint((a[0]+b[0]+c[0]))\n", "a,b,c=input().split()\nprint('A'+b[0]+'C')", "a,b,c = input().split(\" \")\nprint(f\"A{b[0]}C\")", "s = input()\nstrs = s.split(' ')\nc = strs[1][0].upper()\n\nans = \"{}{}{}\".format(strs[0][0], c, strs[2][0])\nprint(ans)", "#48\nS=input().split()\ns=S[1]\nrev_s=list(s)\nprint('A'+rev_s[0]+'C')", "a,b,c=input().split()\nprint(\"A\"+b[0]+\"C\")", "from sys import stdin, stdout\nfrom time import perf_counter\n\nimport sys\nsys.setrecursionlimit(10**9)\nmod = 10**9+7\n\n# import sys\n# sys.stdout = open(\"e:/python/cp/output.txt\",\"w\")\n# sys.stdin = open(\"e:/python/cp/input.txt\",\"r\")\n\n\n\ns = input()\n# print(F\"Atcoder {s.title()} Contest\")\n\n# print(f\"A{s[0].upper()}C \")\nprint(f\"A{s[8].upper()}C\")", "a,b,c =input().split()\n\nprint(\"A\"+ b[0] + \"C\")", "s=input().split()\ns2=s[1]\n\nprint(\"A\"+s2[0]+\"C\")", "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list([int(x) - 1 for x in input().split()])\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nprint(('A' + lstr()[1][0] + 'C'))\n", "title = list(map(str, input().split()))\nprint('A'+title[1][0]+'C')", "a, x, c = input().split()\nprint('A' + x[0] + 'C')", "s = input().split()\nprint(f\"A{s[1][0]}C\")", "a, b, c = map(str, input().split())\nprint(a[0] + b[0] + c[0])", "a, b, c = input().split()\nprint(\"A\" + b[0] + \"C\")", "AtCoder, s, Contest = input().split()\nprint(AtCoder[0] + s[0] + Contest[0])", "x,y,z = input().split()\nprint(x[0]+y[0]+z[0])", "a,b,c=input().split()\nprint(\"A\"+b[0]+\"C\")", "a,b,c=map(str,input().split())\nprint(\"A\"+b[0]+\"C\")", "title = input().split(\" \")\nname = title[1]\nfst = list(name)\nprint((\"A\"+fst[0]+\"C\"))\n", "a,b,c=input().split()\nprint(a[0]+b[0]+c[0])", "a = map(str, input().split())\nname_list = list(a)\nprint('{}{}{}'.format(name_list[0][0], name_list[1][0], name_list[2][0]))", "s, a, b = map(str, input().split())\nprint(\"A\" + a[0] + \"C\")", "A, x, C = list(map(str, input().split()))\nS = 'A' + x[0].upper() + 'C'\nprint(S)", "a,b,c = map(str,input().split())\n\nprint('A'+b[0]+'C')", "a,b,c = list(input().split())\n\nprint(a[0] + b[0] + c[0])", "a, b, c = input().split()\nprint(a[0] + b[0] + c[0])", "S=list(map(str,input().split()))\nprint(\"A\"+S[1][0]+\"C\")"]

{"inputs": ["AtCoder Beginner Contest\n", "AtCoder Snuke Contest\n", "AtCoder X Contest\n"], "outputs": ["ABC\n", "ASC\n", "AXC\n"]}


Question:
Alice and Bob are decorating a Christmas Tree.

Alice wants only $3$ types of ornaments to be used on the Christmas Tree: yellow, blue and red. They have $y$ yellow ornaments, $b$ blue ornaments and $r$ red ornaments.

In Bob's opinion, a Christmas Tree will be beautiful if:  the number of blue ornaments used is greater by exactly $1$ than the number of yellow ornaments, and  the number of red ornaments used is greater by exactly $1$ than the number of blue ornaments.

That is, if they have $8$ yellow ornaments, $13$ blue ornaments and $9$ red ornaments, we can choose $4$ yellow, $5$ blue and $6$ red ornaments ($5=4+1$ and $6=5+1$).

Bob also thinks that a Christmas Tree will be highly difficult to decorate if it has more than 20 ornaments in total.

Alice wants to choose as many ornaments as possible, but she also wants the Christmas Tree to be beautiful according to Bob's opinion.

In the example two paragraphs above, we would choose $7$ yellow, $8$ blue and $9$ red ornaments. If we do it, we will use $7+8+9=24$ ornaments. That is the maximum number.

Since Alice and Bob are busy with preparing food to the New Year's Eve, they are asking you to find out the maximum number of ornaments that can be used in their beautiful Christmas Tree!

It is guaranteed that it is possible to choose at least $6$ ($1+2+3=6$) ornaments.

-----Input-----

The only line contains three integers $y$, $b$, $r$ ($1 \leq y \leq 100$, $2 \leq b \leq 100$, $3 \leq r \leq 100$) — the number of yellow, blue and red ornaments.

It is guaranteed that it is possible to choose at least $6$ ($1+2+3=6$) ornaments.

-----Output-----

Print one number — the maximum number of ornaments that can be used.

-----Examples-----
Input
8 13 9

Output
24
Input
13 3 6

Output
9

-----Note-----

In the first example, the answer is $7+8+9=24$.

In the second example, the answer is $2+3+4=9$.

["y,b,r=map(int,input().split())\nm=min(y,b-1,r-2)\nprint(3*m+3)", "def main():\n    y, b, r = map(int, input().split())\n    mn = min(r - 2, b - 1, y)\n    if (mn < 0):\n        print(0)\n    else:\n        print(mn * 3 + 3)\n\nmain()", "a, b, c = map(int, input().split())\nprint(min(a, b - 1, c - 2) * 3 + 3)", "\nimport sys\n#sys.stdin=open(\"data.txt\")\ninput=sys.stdin.readline\nmii=lambda:list(map(int,input().split()))\n\na,b,c=mii()\nb-=1\nc-=2\nprint(min(a,b,c)*3+3)\n", "y, b, r = list(map(int, input().split()))\nprint(min(y, b - 1, r - 2) * 3 + 3)\n", "y, b, r = list(map(int, input().split()))\nk = min(y, b - 1, r - 2)\nprint(k * 3 + 3)\n", "y, b, r = list(map(int, input().split()))\nb -= 1\nr -= 2\nprint(3 * min(y, b, r) + 3)\n", "\na, b, c = map(int, input().split())\nx = min(a, b - 1, c - 2)\nprint(x + x + 1 + x + 2)", "a, b, c = map(int, input().split())\nans = c\nif b < ans - 1:\n    ans = b + 1\nif a < ans - 2:\n    ans = a + 2\nprint(3 * ans - 3)", "y, b, r = map(int, input().split())\nres = 6\ny -= 1\nb -= 2\nr -= 3\nwhile y * b * r:\n    res += 3\n    y -= 1\n    b -= 1\n    r -= 1\nprint(res)", "y,b,r = [int(x) for x in input().split()]\n\nx = min(y,b-1,r-2)\nprint(3*x+3)", "y,b,r = list(map(int,input().split()))\nb_y = b-1\nr_y = r-2\nprint((min(y,b_y,r_y)+1)*3)\n", "def mi():\n    return list(map(int, input().split()))\n'''\n\n'''\ny,b,r = mi()\nif b>=r:\n    b = r-1\nelse:\n    r = b+1\nif y>=b:\n    y = b-1\nelse:\n    b = y+1\n    r = b+1\nprint(y+r+b)\n", "y,b,r=map(int,input().split())\nb-=1\nr-=2\nprint(min(y,b,r)*3+3)", "from sys import stdin, stdout\nfrom math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial\nfrom random import randint\n\na, b, c = map(int, stdin.readline().split())\nans = 0\n\nfor i in range(1, a + 1):\n    if i + 1 <= b and i + 2 <= c:\n        ans = i * 3 + 3\n\nstdout.write(str(ans))", "a = list(map(int, input().split()))\na[1] -= 1\na[2] -= 2\nk = min(a)\nprint(3 * k + 3)", "# = list(map(int, input().split()))\n# = map(int, input().split())\na, b, c = list(map(int, input().split()))\nans = 0\nfor i in range(a + 1):\n    if b >= i + 1 and c >= i + 2:\n        ans = i * 3 + 3\nprint(ans)\n", "a, b, c = list(map(int, input().split()))\n\nuse = min(a, b - 1, c - 2)\nprint(3 * use + 3)\n", "y, b, r=list(map(int, input().split()))\nx=min(y, b-1, r-2)\nprint(3*x+3)\n", "a, b, c = [int(i) for i in input().split()]\nprint(min(a, b-1, c-2)*3+3)", "y,b,r=list(map(int,input().split()))\n\nx=min(y,b-1,r-2)\n\nprint(x*3+3)\n", "y,b,r = list(map(int,input().split()))\nif b > y+1:\n    b = y+1\nelse:\n    y = b-1\nif r > b+1:\n    r = b+1\nelse:\n    b = r-1\n    y = b-1\nprint(y+b+r)                \n", "a, b, c = list(map(int, input().split()))\nprint(min(3 * a + 3, 3 * b, 3 * c - 3))\n", "y, b, r = list(map(int, input().split()))\nprint(min(y + 1, b, r - 1) * 3)\n", "def read():\n    return int(input())\n\n\ndef readlist():\n    return list(map(int, input().split()))\n\n\ndef readmap():\n    return map(int, input().split())\n\n\ny, b, r = readmap()\n\nb -= 1\nr -= 2\n\nprint(3 * min(y, b, r) + 3)"]


Question:
Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on one stock, Codeforces Ltd. We hope you'll still be able to make profit from the market!

In the morning, there are $n$ opportunities to buy shares. The $i$-th of them allows to buy as many shares as you want, each at the price of $s_i$ bourles.

In the evening, there are $m$ opportunities to sell shares. The $i$-th of them allows to sell as many shares as you want, each at the price of $b_i$ bourles. You can't sell more shares than you have. You also can't sell more than 5 shares if it's morning.

It's morning now and you possess $r$ bourles and no shares.

What is the maximum number of bourles you can hold after the evening?

-----Input-----

The first line of the input contains three integers $n, m, r$ ($1 \leq n \leq 30$, $1 \leq m \leq 30$, $1 \leq r \leq 1000$) — the number of ways to buy the shares on the market, the number of ways to sell the shares on the market, and the number of bourles you hold now.

The next line contains $n$ integers $s_1, s_2, \dots, s_n$ ($1 \leq s_i \leq 1000$); $s_i$ indicates the opportunity to buy shares at the price of $s_i$ bourles.

The following line contains $m$ integers $b_1, b_2, \dots, b_m$ ($1 \leq b_i \leq 1000$); $b_i$ indicates the opportunity to sell shares at the price of $b_i$ bourles.

-----Output-----

Output a single integer — the maximum number of bourles you can hold after the evening.

-----Examples-----
Input
3 4 11
4 2 5
4 4 5 4

Output
26

Input
2 2 50
5 7
4 2

Output
50

-----Note-----

In the first example test, you have $11$ bourles in the morning. It's optimal to buy $5$ shares of a stock at the price of $2$ bourles in the morning, and then to sell all of them at the price of $5$ bourles in the evening. It's easy to verify that you'll have $26$ bourles after the evening.

In the second example test, it's optimal not to take any action.

["n, m, r = map(int, input().split())\nS = list(map(int, input().split()))\nB = list(map(int, input().split()))\nx = min(S)\ny = max(B)\ncnt = r % x\nact = r // x\ncnt += act * y\nprint(max(r, cnt))", "n, m, r = map(int, input().split())\nA = min(list(map(int, input().split())))\nB = max(list(map(int, input().split())))\nif B <= A:\n    print(r)\n\nelse:\n    ans = r % A + (r // A) * B\n    print(ans) ", "n,m,r = map(int,input().split())\nbuy = min(map(int,input().split()))\nsell = max(map(int,input().split()))\n\nif buy < sell:\n    units = r//buy\n    print (units*sell + r - (units*buy))\nelse:\n    print (r)", "n, m, r = list(map(int,input().split()))\nprzed = list(map(int,input().split()))\npo = list(map(int,input().split()))\na = min(przed)\nb = max(po)\nprof = (r // a) * (b - a)\nprof = max(prof, 0)\nprint(r + prof)", "n,m,r = list(map(int,input().split()))\ns = min(list(map(int,input().split())))\nb = max(list(map(int,input().split())))\nprint(max(r, r % s + (r // s) * b))\n", "n,m,r = list(map(int,input().split()))\nS = [int(x) for x in input().split()]\nB = [int(x) for x in input().split()]\n\nstocks = r//min(S)\nleft = r%min(S)\nnewr = left + stocks*max(B)\n\nprint(max(r, newr))\n\n", "n, m, r = list(map(int, input().split()))\ns = list(map(int, input().split()))\nb = list(map(int, input().split()))\nprint(max((r // min(s)) * max(b) + (r % min(s)), r))\n", "#JMD\n#Nagendra Jha-4096\n\n \nimport sys\nimport math\n\n#import fractions\n#import numpy\n \n###File Operations###\nfileoperation=0\nif(fileoperation):\n    orig_stdout = sys.stdout\n    orig_stdin = sys.stdin\n    inputfile = open('W:/Competitive Programming/input.txt', 'r')\n    outputfile = open('W:/Competitive Programming/output.txt', 'w')\n    sys.stdin = inputfile\n    sys.stdout = outputfile\n\n###Defines...###\nmod=1000000007\n \n###FUF's...###\ndef nospace(l):\n    ans=''.join(str(i) for i in l)\n    return ans\n \n \n \n##### Main ####\nt=1\nfor tt in range(t):\n    #n=int(input())\n    n,m,r= map(int, sys.stdin.readline().split(' '))\n    a=list(map(int,sys.stdin.readline().split(' ')))\n    b=list(map(int,sys.stdin.readline().split(' ')))\n    rem=r%min(a)\n    print(max(r,(max(b)*(r//min(a)))+rem))\n    \n    \n#####File Operations#####\nif(fileoperation):\n    sys.stdout = orig_stdout\n    sys.stdin = orig_stdin\n    inputfile.close()\n    outputfile.close()", "n, m, r = list(map(int, input().split()))\ns = list(map(int, input().split()))\nb = list(map(int, input().split()))\nu = min(s)\nv = max(b)\nprint(max(r // u * v + r % u, r))\n", "n, m, r = list(map(int, input().split()))\na = [int(x) for x in input().split()]\nb = [int(x) for x in input().split()]\nmx = 0\nans = r\nfor x in a:\n\tans = max(ans, r // x * max(b) + r % x)\nprint(ans)\n", "n, m, r = [int(i) for i in input().split(' ')]\ns = [int(i) for i in input().split(' ')]\nb = [int(i) for i in input().split(' ')]\ns.sort()\nb.sort()\nif b[-1] >= s[0]:\n    print((r//s[0]) * (b[-1] - s[0]) + r)\nelse:\n    print(r)", "n, m, r = [int(item) for item in input().split()]\n\ns = [int(item) for item in input().split()]\nb = [int(item) for item in input().split()]\n\nx = r // min(s)\n\nprint(max(r, x * max(b) + r % min(s)))\n", "def mp():\n    return map(int, input().split())\n\nn, m, r = mp()\ns = list(mp())\nb = list(mp())\n\nt = r // min(s)\no = r % min(s)\np = max(b) * t\n\nprint(max(r, p + o))", "n, m, r = map(int, input().split())\nl1, l2 = list(map(int, input().split())), list(map(int, input().split()))\nprint(max((r // min(l1)) * max(l2) + r % min(l1), r))", "import io, sys, atexit, os\n\nimport math as ma\nfrom decimal import Decimal as dec\nfrom itertools import permutations\nfrom random import randint as rand\n\n\ndef li ():\n\treturn list (map (int, input ().split ()))\n\n\ndef num ():\n\treturn map (int, input ().split ())\n\n\ndef nu ():\n\treturn int (input ())\n\n\ndef find_gcd ( x, y ):\n\twhile (y):\n\t\tx, y = y, x % y\n\treturn x\n\n\ndef lcm ( x, y ):\n\tgg = find_gcd (x, y)\n\treturn (x * y // gg)\n\n\nmm = 1000000007\nyp = 0\ndef solve ():\n\tt=1\n\tfor _ in range(t):\n\t\tn,m,r=num()\n\t\ta=li()\n\t\tb=li()\n\t\ta.sort()\n\t\tb.sort()\n\t\tpq=r//a[0]\n\t\tprint(max(pq*b[m-1]+r%a[0],r))\n\n\n\ndef __starting_point():\n\tsolve ()\n__starting_point()", "n, m, r = list(map(int, input().split()))\na = min(list(map(int, input().split())))\nb = max(list(map(int, input().split())))\nprint(max(r, (r//a)*(b-a)+r))\n", "n, m, k = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nans = k % min(a)\ncur = k // min(a)\nif min(a) > max(b):\n    print(k)\n    return\nprint(max(b) * cur + ans)", "N, M, R= list(map(int, input().split()))\n\nb = sorted(list(map(int,input().split())))\nc = sorted(list(map(int,input().split())))\n\nif b[0] < c[-1]:\n    cnt = R // b[0]\n    R %= b[0]\n    R += cnt * c[-1]\nprint(R)\n\n", "n,m,r=(int(i) for i in input().split())\ns=[int(i) for i in input().split()]\nb=[int(i) for i in input().split()]\nm=min(s)\na=r//m\nk=r-m*(r//m)\np=a*max(b)\nprint(max(p+k,r))\n", "import sys\n# gcd\n# from fractions import gcd\n# from math import ceil, floor\n# from copy import deepcopy\nfrom itertools import accumulate\n# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']\n# S = Counter(l)  # make Counter Class\n# print(S.most_common(2))  # [('b', 5), ('c', 4)]\n# print(S.keys())  # dict_keys(['a', 'b', 'c'])\n# print(S.values())  # dict_values([3, 5, 4])\n# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])\n# from collections import Counter\n# import math\n# from functools import reduce\n#\ninput = sys.stdin.readline\ndef ii(): return int(input())\ndef mi(): return list(map(int, input().rstrip().split()))\ndef lmi(): return list(map(int, input().rstrip().split()))\ndef li(): return list(input().rstrip())\n# template\n\n\nn, m, r = mi()\ns = lmi()\nb = lmi()\ns.sort()\nb.sort()\nb.reverse()\na = s[0]\nz = b[0]\n\nprint(max(r+(z-a)*(r//a), r))\n", "n, m , r  = map(int, input().split())\n\ns = [int(x) for x in input().split()]\nb = [int(x) for x in input().split()]\n\nmi = min(s)\nma = max(b)\n\nif mi < ma:\n    print((r // mi) * ma + r % mi)\nelse:\n    print(r)", "n, m, r = list(map(int,input().split()))\nsi = list(map(int,input().split()))\nbi = list(map(int,input().split()))\nprint(max(r,r // min(si) * max(bi) + r % min(si)))\n", "#codeforces1150A_live\ngi = lambda : list(map(int,input().strip().split()))\nn,m,r = gi()\nl = gi()\nll = gi()\nans = (r//min(l))*max(ll) + r%min(l)\nif ans < r:\n\tans = r\nprint(ans)\n", "n, m, r = map(int, input().split())\nbuys = list(map(int, input().split()))\nsells = list(map(int, input().split()))\nmin_buys = min(buys)\nmax_selss = max(sells)\nif min_buys < max_selss:\n\tprint(r%min_buys+ r//min_buys*max_selss)\nelse:\n\tprint(r)"]


Question:
George decided to prepare a Codesecrof round, so he has prepared m problems for the round. Let's number the problems with integers 1 through m. George estimates the i-th problem's complexity by integer b_{i}.

Of the m problems, each odd-indexed problem (problems 1, 3, 5, ...) is annoying for solvers.

To make the round good, he needs to put at least n problems there. Besides, he needs to have at least one problem with complexity exactly a_1, at least one with complexity exactly a_2, ..., and at least one with complexity exactly a_{n}. Of course, the round can also have problems with other complexities.

George has a poor imagination. It's easier for him to make some already prepared problem simpler than to come up with a new one and prepare it. George is magnificent at simplifying problems. He can simplify any already prepared problem with complexity c to any positive integer complexity d (c ≥ d), by changing limits on the input data.

However, nothing is so simple. George understood that even if he simplifies some problems, he can run out of problems for a good round. That's why he decided to find out the minimum number of problems he needs to come up with in addition to the m he's prepared in order to make a good round. Note that George can come up with a new problem of any complexity.

-----Input-----

The first line contains two integers n and m (1 ≤ n, m ≤ 3000) — the minimal number of problems in a good round and the number of problems George's prepared. The second line contains space-separated integers a_1, a_2, ..., a_{n} (1 ≤ a_1 < a_2 < ... < a_{n} ≤ 10^6) — the requirements for the complexity of the problems in a good round. The third line contains space-separated integers b_1, b_2, ..., b_{m} (1 ≤ b_1 ≤ b_2... ≤ b_{m} ≤ 10^6) — the complexities of the problems prepared by George.

-----Output-----

Print a single integer — the answer to the problem.

-----Examples-----
Input
3 5
1 2 3
1 2 2 3 3

Output
0

Input
3 5
1 2 3
1 1 1 1 1

Output
2

Input
3 1
2 3 4
1

Output
3

-----Note-----

In the first sample the set of the prepared problems meets the requirements for a good round.

In the second sample, it is enough to come up with and prepare two problems with complexities 2 and 3 to get a good round.

In the third sample it is very easy to get a good round if come up with and prepare extra problems with complexities: 2, 3, 4.

["n, m = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\ni, j = 0, 0\nwhile i < n:\n    while j < m and b[j] < a[i]:\n        j += 1\n    if j == m:\n        break\n    j += 1\n    i += 1\nprint(n - i)", "n, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nA.sort()\nB.sort()\ni, j = len(A) - 1, len(B) - 1\nres = 0\n\nwhile i >= 0 and j >= 0:\n    if A[i] > B[j]:\n        res += 1\n        i -= 1\n    else:\n        j -= 1\n        i -= 1\nres += i + 1\nprint(res)\n", "n, m = map(int, input().split())\ngeorg = list(map(int, input().split()))\n\ngood = list(map(int, input().split()))\ngood.sort()\ngeorg.sort()\ncandoc = 0\nj = 0\nfor i in range(min(n, m)):\n    while j < m and good[j] < georg[i]: j += 1\n    if j>=m:break\n    if good[j] >= georg[i]:\n        candoc += 1\n        j+=1\n    if j>=m:break\nprint(n-candoc)", "n,m=map(int,input().split())\na=list(map(int,input().split()))\nb=list(map(int,input().split()))\na.sort()\nb.sort()\ni=0\nj=0\nwhile i<n and j<m:\n    if a[i]<=b[j]:\n        i+=1\n    j+=1\nprint(n-i)", "n,m=map(int,input().split())\ntreb=list(map(int,input().split()))\nest=list(map(int,input().split()))\nc=[0 for i in range(max(treb[-1],est[-1])+1)]\nfor i in range(n):\n    c[treb[i]-1]+=1\ni=m-1\ne=n\nq=treb[-1]\nwhile i!=-1:\n    d=True\n    for j in range(min(est[i]-1,q),-1,-1):\n        if c[j]>0:\n            q=j\n            c[j]-=1\n            d=False\n            e-=1\n            break\n    if d:\n        print(e)\n        return\n    i-=1\nprint(e)", "import sys\nimport math\nimport heapq\nimport random\nimport collections\nimport bisect\nimport datetime\n\ndef main():\n    # sys.stdin = open('input.txt', 'r')\n    # sys.stdout = open('output.txt', 'w')\n\n    n = list(map(int, input().strip().split()))\n    l1 = list(map(int, input().strip().split()))\n    l2 = list(map(int, input().strip().split()))\n    count = 0\n\n    for i in l1:\n        pos = bisect.bisect_left(l2, i)\n\n        if pos < len(l2) and l2[pos] >= i:\n                l2 = l2[pos+1:]\n\n        else:\n            count = count + 1\n\n    print(count)\n\n    # sys.stdin.close()\n    # sys.stdout.close()\n\ndef __starting_point():\n    main()\n\n__starting_point()", "def main():\n    n,m=list(map(int,input().split()))\n    a=list(map(int,input().split()))\n    b=list(map(int,input().split()))\n    \n    c=list()\n\n    for x in a:\n        if x in b:\n            b.pop(b.index(x))\n        else:\n            c.append(x)\n    L=0\n    if len(c)==0:\n        return 0\n    i=0\n    while len(c):\n        while i<len(b) and (b[i]<c[0]):\n            i+=1\n        if i==len(b):\n            return len(c)\n        b.pop(i)\n        c.pop(0)\n    return len(c)\n\n        \nprint(main())\n", "n, m = tuple(map(int,input().split(' ')))\na = list(map(int,input().split(' ')))\nb = list(map(int,input().split(' ')))\nwhile len(a)>0 and len(b)>0:\n    if a[0]<=b[0]: a.pop(0)\n    b.pop(0)\nprint(len(a))\n", "from bisect import bisect_left\ndef binr(a, x, lo=0, hi=None):   \n    hi = hi if hi is not None else len(a)  \n    pos = bisect_left(a,x,lo,hi)    \n    if pos < hi:\n        return pos\n    else:\n        return -1\nn,m = map(int,input().split())\nd = [int(x) for x in input().split()]\na = [int(x) for x in input().split()]\nfl = True\nans = 0\nfor i in d:\n    if (i not in a):\n        fl = False\nif fl == True:\n    print(0)\n    return\nfor i in range(n):\n    if d[i] in a:\n        d[i] = 0\n    r = binr(a,d[i])\n    if r == -1:\n        ans += 1\n    else:\n        a[r] = -1\n    a.sort()\nprint(ans)   ", "import re\n\ntemp=input()\ntemp=re.split(' ',temp)\nn=eval(temp[0])\nm=eval(temp[1])\ntemp=input()\ntemp=re.split(' ',temp)\na=[]\nfor i in range(n):\n  a.append(eval(temp[i]))\ni=0\ntemp=input()\ntemp=re.split(' ',temp)\nfor j in range(m):\n  x=eval(temp[j])\n  if i>=n: continue\n  if x>=a[i]: i+=1\nans=n-i\nprint(ans)", "n, m = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\ni = j = 0\nwhile i < n:\n    while j < m and b[j] < a[i]: j += 1\n    if j == m: break\n    j += 1\n    i += 1\nprint(n - i)", "R = lambda: list(map(int, input().split()))\nn, m = R()\na = R()\nb = R()\nc = 0\ni = j = 0\nwhile i < n:\n  while j < m and b[j] < a[i]:\n    j += 1\n  if j == m:\n    break\n  c += 1\n  i += 1\n  j += 1\nprint(n - c)", "R = lambda: list(map(int, input().split()))\nn, m = R()\na = R()\nb = R()\ni = j = 0\nwhile i < n and j < m:\n  if b[j] < a[i]:\n    j += 1\n  else:\n    i += 1\n    j += 1\nprint(n - i)", "R = lambda: list(map(int, input().split()))\nn, m = R()\na = R()\nb = R()\ni = j = 0\nwhile i < n and j < m:\n  if b[j] >= a[i]:\n    i += 1\n  j += 1\nprint(n - i)", "'''\nCreated on Jun 4, 2014\n\n@author: Nathaniel\n'''\n\nimport bisect\n\ndef nexti():\n    return list(map(int, input().split()))\ndef nextl():\n    return list(map(int, input().split()))\n\nn, m = nexti()\na = sorted(nextl())\nb = sorted(nextl())\ncount = 0\ni=0\nj=0\nn = len(a)\n\nwhile i < n:\n    bis = bisect.bisect_left(b, a[i])\n    if bis != len(b):\n        count+=1\n        del b[bis]\n    i+=1\nprint(n - count)\n        \n\n", "n, m = list(map(int, input().split()))\na = sorted(list(map(int, input().split())))\nb = sorted(list(map(int, input().split())))\n\ni, j = 0, 0\nwhile i < n and j < m:\n\tif a[i] <= b[j]:\n\t\ti += 1\n\tj += 1\nprint(n-i)\n", "import sys\nimport math\n\nn, m = [int(x) for x in (sys.stdin.readline()).split()]\nan = [int(x) for x in (sys.stdin.readline()).split()]\nbm = [int(x) for x in (sys.stdin.readline()).split()]\n\ni = 0\nj = 0\nres = n\nwhile(i < n):\n    while(j < m and an[i] > bm[j]):\n        j += 1  \n        \n    if(j < m and an[i] <= bm[j]):\n        res -= 1\n        j += 1\n    \n    i += 1\n    \nprint(res)\n", "n, m = [int(x) for x in input().split()]\na = [int(x) for x in input().split()]\nb = [int(x) for x in input().split()]\nptr = 0\nfound = 0\nfor task in a:\n\twhile ptr < m and b[ptr] < task:\n\t\tptr += 1\n\tif ptr < m and b[ptr] >= task:\n\t\tfound += 1\n\t\tptr += 1\nprint(n - found)\n", "def main():\n    n, m = map(int, input().split())\n    aa = list(map(int, input().split()))\n    it = iter(list(map(int, input().split())))\n    try:\n        for i, a in enumerate(aa, 1):\n            b = next(it)\n            while b < a:\n                b = next(it)\n    except StopIteration:\n        i -= 1\n    print(n - i)\n\n\ndef __starting_point():\n    main()\n__starting_point()", "I=lambda:list(map(int,input().split()))\nn,m=I();a=I();b=I()\ni=j=0\nwhile(i<n and j<m):\n    i+=1*(a[i]<=b[j]);j+=1\nprint(n-i)", "# coding: utf-8\nfrom collections import Counter\nn, m = [int(i) for i in input().split()]\na = Counter([int(i) for i in input().split()])\nb = Counter([int(i) for i in input().split()])\naa = list((a-b).elements())\nbb = list((b-a).elements())\ncnt = sum(a.values())-len(aa)\naa.sort()\nbb.sort()\ni = 0\nj = 0\nwhile i < len(aa):\n    while j < len(bb) and bb[j]<aa[i]:\n        j += 1\n    if j < len(bb) and bb[j]>aa[i]:\n        cnt += 1\n        j += 1\n    i += 1\nprint(n-cnt)\n", "# coding: utf-8\nfrom collections import Counter\nn, m = [int(i) for i in input().split()]\na = Counter([int(i) for i in input().split()])\nb = Counter([int(i) for i in input().split()])\naa = sorted(list((a-b).elements()))\nbb = sorted(list((b-a).elements()))\ncnt = sum(a.values())-len(aa)\ni = 0\nj = 0\nwhile i < len(aa):\n    while j < len(bb) and bb[j]<aa[i]:\n        j += 1\n    if j < len(bb) and bb[j]>aa[i]:\n        cnt += 1\n        j += 1\n    i += 1\nprint(n-cnt)\n", "R = lambda:list(map(int,input().split()))\nn,m = R()\na = R()\nb = R()\nr = 0\nfor x in a:\n    c = 0\n    for y in b:\n        if y>=x:\n            c = 1\n            b.pop(b.index(y))\n            break\n    if c == 0:\n        r += 1\nprint(r)", "n, m = map(int, input().split())\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\n\na.sort()\nb.sort()\n\nj = -1\n\ncnt = 0\n\nfor v in a:\n    j += 1\n    while j < m and v > b[j]:\n        j += 1\n\n    if j >= m:\n        cnt += 1\n\nprint(cnt)", "n, m = map(int, input().split())\nc = list(sorted(map(int, input().split())))\nd = list(sorted(map(int, input().split())))\ni, j = 0, 0\nwhile i < n and j < m:\n    if c[i] <= d[j]:\n        i += 1\n    j += 1\nprint(n-i)"]


Question:
You are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 × 4 cake may look as follows: [Image]

The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contains at least one cake cell that has not been eaten before, and eats all the cake cells there. He may decide to eat any number of times.

Also, each cell adjacent to an evil strawberry (ie. one cell leftward, rightward, above or below the evil strawberry) is considered untasty.

Please output the maximum number of cake cells that the cakeminator can eat.

-----Input-----

The first line contains two integers r and c (2 ≤ r, c ≤ 10), denoting the number of rows and the number of columns of the cake. The next r lines each contains c characters — the j-th character of the i-th line denotes the content of the cell at row i and column j, and is either one of these:   '.' character denotes a cake cell with no evil strawberry;  'S' character denotes a cake cell with an evil strawberry.

-----Output-----

Output the maximum number of cake cells that the cakeminator can eat.

-----Examples-----
Input
3 4
S...
....
..S.

Output
8

-----Note-----

For the first example, one possible way to eat the maximum number of cake cells is as follows (perform 3 eats). [Image]  [Image]  [Image]

["r, c = list(map(int, input().split()))\ncake = [input().strip() for _ in range(r)]\nans = 0\nfor i in range(r):\n    for j in range(c):\n        if cake[i][j] == '.' and ('S' not in cake[i] or 'S' not in list(zip(*cake))[j]):\n            ans += 1\nprint(ans)\n", "r,c=input().split()\nr=int(r)\nc=int(c)\nrows=[]\nevils=0\nfor i in range(r):\n    rows.append(input())\n    evils+=rows[-1].count('S')\neaten=(r*c)-evils\ncolumns=[]\nfor i in range(c):\n    L=[]\n    for j in range(r):\n        L.append(rows[j][i])\n    columns.append(L)\n\nfor i in range(r):\n    for j in range(c):\n        if(rows[i][j]=='S'):\n            continue\n        elif('S' in rows[i] and 'S' in columns[j]):            \n            eaten-=1\nprint(eaten)\n\n\n", "n,m = map(int,input().split())\ngrid = [input() for line in range(n)]\nrows = len([line for line in grid if line == '.'*m])\ncols = len([True for col in range(m) if len([row[col] for row in grid if row[col] == '.']) == n])\nprint(rows*m+cols*n-rows*cols)", "def eat_cake(cols, rows, string):\n    \"\"\"\n    >>> eat_cake(4, 3, ['S...', '....', '..S.'])\n    8\n    \"\"\"\n    result = 0\n    #each row\n    for i in range(0, rows):\n        if 'S' not in string[i]:\n            result += cols\n            string[i] = string[i].replace('.', 'E')\n\n    #each coloumn\n    for i in range(0, cols):\n        contains = False\n        all_eaten = True\n        already_eaten = 0\n        for j in range(0, rows):\n            if string[j][i] == 'S':\n                contains = True\n            if string[j][i] == '.':\n                all_eaten = False\n            \n            if string[j][i] == 'E':\n                already_eaten += 1\n                \n\n        if (all_eaten == False and contains == False):\n            result += rows - already_eaten\n            for row in range(0, rows):\n                string[row] = string[row][0 : i] + 'E' + string[row][i+1:]\n                \n            \n\n    return result\n    \n        \n\n\ndef main():\n    first_line = input()\n    first_line = first_line.split()\n    \n    rows = int(first_line[0])\n    coloumns = int(first_line[1])\n\n    l = []\n    for i in range(rows):\n        line = input()\n        l.append(line)\n        \n    print(eat_cake(coloumns, rows, l))\n    \n\n#import doctest\n#doctest.testmod()\nmain()   \n", "import sys\nfin = sys.stdin\n\nn, m = map(int, fin.readline().split())\nisRowFree = [True] * n\nisColFree = [True] * m\n\nfor i in range(n):\n    s = fin.readline().strip()\n    for j in range(m):\n        if s[j] == 'S':\n            isRowFree[i] = False\n            isColFree[j] = False\n      \ndef FreeRows():\n    return sum(1 for i in range(n) if isRowFree[i])\ndef FreeColumns():\n    return sum(1 for i in range(m) if isColFree[i])      \n\na = FreeRows()\nb = FreeColumns()      \n      \nprint(a * m + b * (n - a))", "r, c = list(map(int, input().split()))\nstr = []\nfor i in range (0, r):\n    aLine = input()\n    str.append(aLine)\nres = 0\nfor i in range (0, r):\n    k = 1\n    for j in range (0, c):\n        if str[i][j] == 'S':\n            k = 0\n            break\n    if k == 1:\n        res = res + c\n        str[i] = ''\n        for j in range (0, c):\n            str[i] = str[i] + '0'\nfor j in range (0, c):\n    k = 1\n    for i in range (0, r):\n        if str[i][j] == 'S':\n            k = 0\n            break\n    if k == 1:\n        for i in range (0, r):\n            if str[i][j] == '.':\n                res = res + 1\nprint (res)\n\n", "n,m =[int(x) for x in input().split()]\na = []\nans = 0\nfor i in range(n):\n    a.append(list(input()))\nfor i in range(n):\n    flag = 1\n    for j in range(m):\n        if a[i][j] == 'S':\n            flag = 0\n    if flag == 1:\n        for j in range(m):\n            a[i][j] = 'T'\nfor i in range(m):\n    flag = 1\n    for j in range(n):\n        if a[j][i] == 'S':\n            flag = 0\n    if flag == 1:\n        for j in range(n):\n            a[j][i] = 'T'\nfor i in range(n):\n    for j in range(m):\n        if a[i][j] == 'T':\n            ans +=1 \nprint(ans)", "n,m = list(map(int,input().split()))\ng = [input() for i in range(n)]\nprint(sum([1 for i in range(n) for j in range(m) if g[i][j] == '.' and not (any([g[i][k] == 'S' for k in range(m)]) and any([g[k][j] == 'S' for k in range(n)]))]))\n", "I=input\nn,m = list(map(int,I().split()))\ng = [I() for i in range(n)]\nprint(n*m-len([1 for i in g if i.count('S')])*len([1 for i in zip(*g) if i.count('S')]))\n", "import sys\n\t\ndef main():\n\tcake = []\n\tr, c = list(map(int, sys.stdin.readline().split()))\n\tfor i in range(r):\n\t\tcake.append(sys.stdin.readline().strip())\n\trow_count = 0\n\tfor i in range(r):\n\t\tfound_strawberry = False\n\t\tfor j in range(c):\n\t\t\tif cake[i][j] == 'S':\n\t\t\t\tfound_strawberry = True\n\t\t\t\tbreak\n\t\tif found_strawberry is False:\n\t\t\trow_count += 1\n\tcol_count = 0\n\tfor j in range(c):\n\t\tfound_strawberry = False\n\t\tfor i in range(r):\n\t\t\tif cake[i][j] == 'S':\n\t\t\t\tfound_strawberry = True\n\t\t\t\tbreak\n\t\tif found_strawberry is False:\n\t\t\tcol_count += 1\n\tprint(row_count * c + col_count * r - row_count * col_count)\n\t\ndef __starting_point():\n    return(main())\n\n__starting_point()", "n, m = list(map(int, input().split()))\narr = [input() for _ in range(n)]\nset1 = []\nset2 = []\nfor i in range(n):\n  for j in range(m):\n    if arr[i][j]=='S':\n      set1.append(i)\n      set2.append(j)\nlen1 = int(n - len(set(set1)))\nlen2 = int(m - len(set(set2)))\n\nprint(len1 * m + len2 *n - len2 * len1)\n\n\n", "r,c = list(map (int, input().split()))\n\nhoriz,vert = [], []\n\nfor i in range(r):\n    horiz.append ([])\nfor i in range(c):\n    vert.append ([])\n\nfor i in range (r):\n    s = input()\n    for j in range (c):\n        horiz[i].append (s[j])\n        vert[j].append (s[j])\n\nans = r * c\nfor i in range (r):\n    for j in range (c):\n        if ('S' in horiz[i]) and ('S' in vert[j]):\n            ans -= 1\nprint (ans)\n", "S=input\nn,m=map(int,S().split())\ng=[S() for i in range(n)]\nprint(n*m-len([1 for i in g if i.count('S')])*len([1 for i in zip(*g) if i.count('S')]))", "r, c = map(int, input().split())\na = [input() for i in range(r)]\nt1 = set()\nt2 = set()\nfor i in range(r):\n    for j in range(c):\n        if a[i][j] == 'S':\n            t1.add(i)\n            t2.add(j)\nn = r - len(t1)\nm = c - len(t2)\nprint(n * c + m * r - n * m)", "r, c = map(int, input().split())\na = [input() for i in range(r)]\nn = len([0 for s in a if 'S' not in s])\nm = len([0 for j in range(c) if len([s[j] for s in a if s[j] =='.']) == r])\nprint(n * c + m * r - n * m)", "n, m = list(map(int, input().split()))\narr = [input() for _ in range(n)]\nset1 = []\nset2 = []\nfor i in range(n):\n  for j in range(m):\n    if arr[i][j]=='S':\n      set1.append(i)\n      set2.append(j)\nlen1 = int(n - len(set(set1)))\nlen2 = int(m - len(set(set2)))\n\nprint(len1 * m + len2 *n - len2 * len1)\n", "s = input().split()\nr = int( s[0] )\nc = int( s[1] )\na = []\nfor i in range( r ):\n\ta.append( input() )\nrow = r\ncol = c\nfor s in a:\n\tfor x in s:\n\t\tif x == 'S':\n\t\t\trow -= 1\n\t\t\tbreak\nfor i in range( c ):\n\tfor j in range( r ):\n\t\tif a[j][i] == 'S':\n\t\t\tcol -= 1\n\t\t\tbreak\n\t\t\t\nprint( row*c + col*r - col*row )\n\t\t\n", "\nr,c=list(map(int,input().split()))\n\nl=[0]*c\nh=[0]*r\na=[]\nfor i in range(r):\n    a.append([])\n    ls=list(input())\n    for j in range(c):\n        a[i].append(ls[j])\n       \n        if a[i][j]!='.' :\n            l[j]=1\n            h[i]=1\n        else:\n            a[i][j]=1\n\n            \n\nt=0\nfor i in range(r):\n    if h[i]==0 :\n        for j in range(c):\n            t+=a[i][j]\n            a[i][j]=0\n\nfor i in range(c):\n    if l[i]==0:\n        for j in range(r):\n            t+=a[j][i]\n            a[j][i]=0\n\nprint(t)      \n\n         \n", "import sys\nmy_file = sys.stdin\n#my_file = open(\"input.txt\", \"r\")\nline = [int(i) for i in my_file.readline().strip(\"\\n\").split()]\nr, c = line[0], line[1]\ntable = my_file.read().split()\nnew_table = []\nfor line in table:\n    if \"S\" in line:\n        new_table.append(line)\nres = (len(table) - len(new_table))*c\nr -= len(table) - len(new_table)\nfor col in range(c):\n    for row in range(r):\n        if \"S\" in new_table[row][col]:\n            break\n    else:\n        res += r\nprint(res)", "r, c = list(map(int, input().split()))\n\nrt = [0] * 10\nct = [0] * 10\n\nfor i in range(r):\n    s = str(input())\n    for j in range(len(s)):\n        if s[j] == 'S':\n            rt[i] = 1\n            ct[j] = 1\n\ncnt = 0\nfor i in range(r):\n    for j in range(c):\n        if rt[i] == 0 or ct[j] == 0:\n            cnt += 1\n\nprint(cnt)\n", "a, b = map(int, input().split())\ns, p = 0, [[0] * b for i in range(a)]\nfor i in range(a):\n    t = input()\n    if 'S' in t:\n        for j in range(b):\n            p[i][j] |= 1\n            if t[j] == 'S':\n                for k in range(a):\n                    p[k][j] |= 2\nfor i in range(a):\n    s += p[i].count(3)\nprint(a * b - s)", "def main(r,c,seq):\n\tanswer = 0\n\tfor i in range(r):\n\t\tk = seq[i].count(1)\n\t\tif k==0:\n\t\t\tfor j in range(c):\n\t\t\t\titem = seq[i][j]\n\t\t\t\tif item==0:\n\t\t\t\t\tseq[i][j]=2\n\t\t\t\t\tanswer+=1\n\tfor i in range(c):\n\t\ttemp = 0\n\t\tfor j in range(r):\n\t\t\titem = seq[j][i]\n\t\t\tif item==0:\n\t\t\t\ttemp+=1\n\t\t\telif item==1:\n\t\t\t\ttemp=0\n\t\t\t\tbreak\n\n\t\tanswer+=temp\n\n\n\treturn answer\n\ndef init():\n\tr,c = list(map(int, input().split()))\n\tseq = []\n\tfor i in range(r):\n\t\ttemp = []\n\t\tfor item in input():\n\t\t\tif item=='S':\n\t\t\t\ttemp+=[1]\n\t\t\telse:\n\t\t\t\ttemp+=[0]\n\t\tseq.append(temp)\n\n\tprint(main(r,c,seq))\n\ninit()", "def how_many(rows, cols):\n    n = 0\n\n    # Eat rows\n    for i in range(len(rows)):\n        if 'S' not in rows[i]:\n            for j in range(len(cols)):\n                rows[i][j] = 'E'\n                cols[j][i] = 'E'\n                n += 1\n    # eat coloumns\n    for j in range(len(cols)):\n            if 'S' not in cols[j]:\n                n += cols[j].count('.')\n                \n    return n\n\n            \n\ndef main():\n    first_line = input()\n    first_line = first_line.split()\n    \n    r = int(first_line[0])\n    c = int(first_line[1])\n    \n    rows = []\n\n    for i in range(r):\n        line = input()\n        rows += [list(line)]\n\n    coloumns = [[rows[i][j] for i in range(r)] for j in range(c)]\n\n    print(how_many(rows, coloumns))\n    \n        \n    \n\n\nmain()   \n", "r,c=list(map(int,input().split()))\n\nL=[]\n\nfor i in range(r):\n    s=input()\n    L.append(str(s))\nans=r*c\nfor i in range(r):\n    for j in range(c):\n        if(L[i][j]==\"S\"):\n            ans-=1\n            continue\n        if(\"S\" in L[i]):\n            case=False\n            for z in range(r):\n                if(L[z][j]==\"S\"):\n                    case=True\n                    break\n            if(case):\n                ans-=1\nprint(ans)\n", "r, c = list(map(int, input().split()))\na = []\nfor i in range(r):\n    a.append(input())\n\nx = r\nfor i in range(r):\n    for j in range(c):\n        if a[i][j] == 'S':\n            x -= 1\n            break\n\ny = c\nfor j in range(c):\n    for i in range(r):\n        if a[i][j] == 'S':\n            y -= 1\n            break\n\nprint(x*c+r*y-x*y)\n\n"]