Harryxun/stf_run huggingface dataset:
s = input()
k = int(input())
m = 0
n = 0
j = 0
for i in range(len(s)):
    if s.count(s[0]) == len(s):
        print(len(s) * k // 2)
        exit()
    if len(s) <= j + 1:
        if s[0] == s[-1] == s[-2]== s[-3]== s[-4]== s[-5]== s[len(s)//3] \
                and s[0] == s[1] == s[2]== s[3]== s[4]== s[5]:
            print(s[10000000000000000000000000])
        break
    if s[j] == s[j + 1]:
        if j == len(s) - 1:
            n += 1
        else:
            m += 1
        j += 1
    j += 1
print(m * k + n)


### FIXED CODE ###

s = input()
k = int(input())
m = 0
n = 0
j = 0
for i in range(len(s)):
    if s.count(s[0]) == len(s):
        print(len(s) * k // 2)
        exit()
    if len(s) <= j + 1:
        if s[0] == s[-1] == s[-2]== s[-3]== s[-4]== s[-5]== s[len(s)//3] \
                and s[0] == s[1] == s[2]== s[3]== s[4]== s[5]:
            n+=1
        break
    if s[j] == s[j + 1]:
        if j == len(s) - 1:
            n += 1
        else:
            m += 1
        j += 1
    j += 1
print(m * k + n*(k-1))
input1 = int(input())
input2 = int(input())
result = input1 * input2
if (result % 2) == 0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

a, b = map(int, input().split())
if ((a*b) % 2) == 0:
    print("Even")
else:
    print("Odd")
a,b,c=list(input().split())
if a[-1]==b[1] and b[-1]==c[1]:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
s = str(input())
n = len(s)

if n == 1:
    print(1)
    exit()

maxs = []
for i in range(n-1):
    if s[i] != s[i+1]:
        maxs.append(max(i+1, n-i-1))
print(min(maxs))

### FIXED CODE ###

s = str(input())
n = len(s)

if n == 1:
    print(1)
    exit()

maxs = []
for i in range(n-1):
    if s[i] != s[i+1]:
        maxs.append(max(i+1, n-i-1))

if maxs != []:
    print(min(maxs))
else:
    print(n)
N = int(input())
V =  [int(i) for i in input().split()]
V1 = [V[2*j-2] for j in range(1, N//2+1)]
V2 = [V[2*j-1] for j in range(1, N//2+1)]
#print(V1, V2)

def dict(x):
  D = {}
  for i in x:
    if i in D:
      D[i] += 1
    else:
      D.setdefault(i, 1)
  return D

dictV1 = dict(V1)
dictV2 = dict(V2)
#print(dictV1, dictV2)

sortdictV1 = sorted(dictV1.items(), key=lambda x:x[1], reverse=True)
sortdictV2 = sorted(dictV2.items(), key=lambda x:x[1], reverse=True)
a = 0
if len(dictV1) == 1:
  a = a + 0
else:
  a = a + N/2 - sortdictV1[0][1]
if len(dictV2) == 1:
  a = a + 0
else:
  a = a + N/2 - sortdictV2[0][1]
if sortdictV1[0][0] == sortdictV2[0][0]:
  a = 0
  a = a + min(N/2 - sortdiictV1[0][1] + N/2 - sortdictV2[1][1], N/2 - sortdiictV2[0][1] + N/2 - sortdictV1[1][1])
print(a)


### FIXED CODE ###

N = int(input())
V =  [int(i) for i in input().split()]
V1 = [V[2*j-2] for j in range(1, N//2+1)]
V2 = [V[2*j-1] for j in range(1, N//2+1)]
#print(V1, V2)

def dict(x):
  D = {}
  for i in x:
    if i in D:
      D[i] += 1
    else:
      D.setdefault(i, 1)
  return D

dictV1 = dict(V1)
dictV2 = dict(V2)
#print(dictV1, dictV2)

sortdictV1 = sorted(dictV1.items(), key=lambda x:x[1], reverse=True)
sortdictV2 = sorted(dictV2.items(), key=lambda x:x[1], reverse=True)
a = 0
if sortdictV1[0][0] != sortdictV2[0][0]:
    a = N - sortdictV1[0][1] - sortdictV2[0][1]
else:
  if len(dictV1) == len(dictV2) == 1:
    a = N // 2
  else:
    if len(dictV1) == 1:
      a = N - sortdictV1[0][1] - sortdictV2[1][1]
    elif len(dictV2) == 1:
      a = N - sortdictV1[1][1] - sortdictV2[0][1]
    else:
      a = min(N - sortdictV1[0][1] - sortdictV2[1][1], N - sortdictV1[1][1] - sortdictV2[0][1])
print(a)
# -*- coding: utf-8 -*-
l = [] 
r = []
count = 0

N, M = map(int, input().split())
l = [0] * N
r = [0] * N
for i in range(0,M):
    l[i], r[i] = map(int, input().split())

#idカードの生成
    
for i in range(1,N+1):
    if max(l) <= i and i <= min(r):
        count += 1

print(count)

### FIXED CODE ###

# -*- coding: utf-8 -*-
l = [] 
r = []
count = 0

N, M = map(int, input().split())
l = [0] * M
r = [0] * M
for i in range(0,M):
    l[i], r[i] = map(int, input().split())

#idカードの生成
    
ml = max(l)
mr = min(r)

for i in range(1,N+1):
    if  ml <= i and i <= mr:
        count += 1

print(count)
N = int(input())
S = input()

if N % 2 == 1:
  ans = "No"
else:
  zenhan = S[0:int(N/2)] 
  kouhan = S[int(N/2):N]
  if zenhan == kouhan:
    ans = "Yes"

print(ans)

### FIXED CODE ###

N = int(input())
S = input()

if N % 2 == 1:
  ans = "No"
else:
  zenhan = S[0:int(N/2)] 
  kouhan = S[int(N/2):N]
  if zenhan == kouhan:
    ans = "Yes"
  else:
    ans = "No"

print(ans)
N=int(input())
d=list(map(int,input().split()))

d.sort()
ans=d[N//2+1]-d[N//2]
print(ans)


### FIXED CODE ###

N=int(input())
d=list(map(int,input().split()))

d.sort()
ans=d[N//2]-d[N//2-1]
print(ans)
a = input()
s = int(a[0])
w = int(a[1])

if w <= s:
    print('safe')
else:
    print('unsafe')


### FIXED CODE ###

a = input().split()
s = int(a[0])
w = int(a[1])
 
if w >= s:
    print('unsafe')
else:
    print('safe')
def sadness(l, b):
    sad = 0
    for i, a in enumerate(l, 1):
        sad += abs(a - (b+i))
    return sad

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))

    # y=x+b
    # rough estimate
    if len(l) > 5:
        ls = l[0:5]

    diffset = set()
    for i, a in enumerate(l, 1):
        #print("{} {}".format(i, a))
        diff = i-a
        diffset.add(diff)

    s = set()
    for i in range(max(diffset)+1):
        s.add(sadness(l, i*-1))
    if max(diffset) == 0:
        s.add(sadness(l, 0))

    print("{}".format(min(s)))

### FIXED CODE ###

import numpy as np
def sadness(l, b):
    sad = 0
    for a in l:
        sad += abs(a - b)
    return int(sad)

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    if n == 1:
        print('0')
        exit()

    for i in range(len(l)):
        l[i] -= (i+1)
    nl = np.array(l)
    nl.sort()
    m = np.median(nl)

    s = sadness(l, m)
    print("{}".format(s))
n = int(input())
a = n / 1.08
if a-int(a) == 0.00:
      x = int(a)
else:
      x = int(a) + 1
v = int(x * 1.08)
if v == n:
  print(x)
else:
  print(":(")


### FIXED CODE ###

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2-D1 == 1:
  print(0)
else:
  print(1)
# ??±???????????¢?´¢(Depth First Search)

def DFS(n = 1, A = [0], i = 0, d = [0], f = [0], time = 1):
    for j in range(n):
        if A[i][j] == 1 and d[j] == 0:
            time = time + 1
            d[j] = time
            time = DFS(n, A, j, d, f, time)
    time = time + 1
    f[i] = time
    return time

n = int(raw_input())
A = [0] * n
for i in range(n):
    A[i] = [0] * n

for i in range(n):
    value = map(int, raw_input().split())
    u = value[0] - 1
    k = value[1]
    nodes = value[2:]
    for i in range(k):
        v = nodes[i] - 1
        A[u][v] = 1

d = [0] * n
f = [0] * n

time = 0
for i in range(n):
    if d[i] == 0:
        time = time + 1
        d[i] = time
        time = DFS(n, A, i, d, f, time)

for i in range(n):
    print(str(i + 1) + " " + str(d[i]) + " " + str(f[i]))

### FIXED CODE ###


def DFS(n = 1, i = 0, time = 1):
    for j in range(n):
        if A[i][j] == 1 and d[j] == 0:
            time = time + 1
            d[j] = time
            time = DFS(n, j, time)
    time = time + 1
    f[i] = time
    return time

n = int(raw_input())
A = [0] * n
for i in range(n):
    A[i] = [0] * n

for i in range(n):
    value = map(int, raw_input().split())
    u = value[0] - 1
    k = value[1]
    nodes = value[2:]
    for j in range(k):
        v = nodes[j] - 1
        A[u][v] = 1

d = [0] * n
f = [0] * n

time = 0
for i in range(n):
    if d[i] == 0:
        time = time + 1
        d[i] = time
        time = DFS(n, i, time)

for i in range(n):
    print(str(i + 1) + " " + str(d[i]) + " " + str(f[i]))
N, K = map(int, input().split())
S = input().replace('\n', '')


def solve(S, K):
    record = []
    temp = []
    for i in range(len(S) - 1):
        if S[i:i+2] == '01':
            temp.append(i + 1)
        elif S[i:i+2] == '10':
            if not temp: temp = [0, i]
            else: temp.append(i)
            record.append(temp)
            temp = []
    if len(temp) > 0:
        temp.append(len(S) - 1)
        record.append(temp)
    if S[0] == '0':
        record = [[0, record[0][0] - 1]] + record
    if S[-1] == '0':
        record = record + [[record[-1][-1] + 1, len(S) - 1]]
    if len(record) <= K + 1: return(len(S))
    else:
        cnt = 0
        for i in range(len(record) - K):
            cnt = max(cnt, record[i + K][1] - record[i][0] + 1)
        return(cnt)
print(solve(S, K))

### FIXED CODE ###

N, K = map(int, input().split())
S = input().replace('\n', '')


def solve(S, K):
    record = []
    temp = []
    for i in range(len(S) - 1):
        if S[i:i+2] == '01':
            temp.append(i + 1)
        elif S[i:i+2] == '10':
            if not temp: temp = [0, i]
            else: temp.append(i)
            record.append(temp)
            temp = []
    if len(temp) > 0:
        temp.append(len(S) - 1)
        record.append(temp)
    if S[0] == '0':
        record = [[0, 0]] + record
    if S[-1] == '0':
        record = record + [[len(S) - 1, len(S) - 1]]
    if len(record) <= K + 1: return(len(S))
    else:
        cnt = 0
        for i in range(len(record) - K):
            cnt = max(cnt, record[i + K][1] - record[i][0] + 1)
        return(cnt)
print(solve(S, K))
N, M = map(int,input().split())
for i in range(M):
  if i%2==0:
    j = i//2
    print("{} {}".format(1+j,M+1-j))
  else:
    j = i//2
    print("{} {}".format(M+2+i,2M+1-i))

### FIXED CODE ###

N, M = map(int,input().split())
res = []
for i in range(M):
  if i%2==0:
    j = i//2
    #res.append(M-2*j)
    print("{} {}".format(1+j,M+1-j))
  else:
    j = i//2
    #res.append(M-1-2*j)
    print("{} {}".format(M+2+j,2*M+1-j))
import copy
from sys import exit
from math import ceil
from collections import defaultdict as dd
n = int(input())
yakusuu_dic = dd(lambda: dd(int))
f = [0] * (n+1)
f[1] = 1
f[2] = 2

if n == 1:
    print(1)
    exit()
if n == 2:
    print(5)
    exit()
sosus = [2]

counter = 0
yakusuu_dic[2] = {2: 1}
for num in range(3, n+1):
    #print(num)
    for divider in sosus:
        if num % divider == 0:
            yakusuu_dic[num] = copy.deepcopy(yakusuu_dic[num // divider])
            yakusuu_dic[num][divider] += 1
            if divider in yakusuu_dic[num // divider]:
                f[num] = f[num // divider] // (yakusuu_dic[num // divider][divider] + 1) * (yakusuu_dic[num // divider][divider] + 2)
            else:
                f[num] = f[num // divider] * 2
            break
    else:
        yakusuu_dic[num][num] = 1
        f[num] = 2
        sosus.append(num)

counter = 0
for i in range(1, n+1):
    counter += i * f[i]
print(counter)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
n=int(input())
a=list(map(int,input().split()))
if n==1:
print(a[0])
else:
l=list(map(lambda z:z**2,a)
x=sum(a)
y=sum(l)
t=(x-y)//2
print(t)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
l=list(map(lambda z:z**2,a))
x=sum(a)**2
y=sum(l)
t=(x-y)//2
if t>(10**9+7):
       print(t%(10**9+7))
else:
       print(t)
N = input()
S = input()

print("Yes" if S[0:(N//2)]==S[(N//2):N] else "No")


### FIXED CODE ###

N = int(input())
S = input()

print("Yes" if S[:(N//2)] == S[(N//2):N] else "No")
N=int(input())
X=list(map(int, input().spliet()))
k1=(max(X)+min(X))//2
k2=k1+1
ans1=0
ans2=0
for x in X:
  ans1+=(k1-x)**2
  ans2+=(k2-x)**2

print(min(ans1, ans2))

### FIXED CODE ###

N=int(input())
X=list(map(int, input().split()))
g=sum(X)/N
if g-int(g)>=0.5:
  g=int(g)+1
else:
  g=int(g)   
ans=0
for x in X:
  ans+=(x-g)**2

print(ans)
S = input()
s = S.count(”o”)*100
 
print(700+s)

### FIXED CODE ###

S = input()
s = S.count('o')*100
 
print(700+s)
s = input()

for i in range(len(s) - 2):
    if (s[i] == s[i + 1] or s[i] == s[i + 2]):
        print("{} {}".format(i + 1, i + 3))
        break
else:
    if (s[-2] == s[-1]):
        print("{} {}".format(len(n) - 1, len(n)))
    else:
        print("-1 -1")



### FIXED CODE ###

s = input()

for i in range(len(s) - 2):
    if (s[i] == s[i + 1] or s[i] == s[i + 2]):
        print("{} {}".format(i + 1, i + 3))
        break
else:
    if (s[-2] == s[-1]):
        print("{} {}".format(len(s) - 1, len(s)))
    else:
        print("-1 -1")
n, m = [int(x) for x in input().split()]
img_a = []
img_b = []

for i in range(n):
    img_a.append(input())

for i in range(m):
    img_b.append(input())

ans = "No"
for a in range(n - m + 1):
    dup_a = img_a.copy()
    dup_b = img_b.copy()
    flag = True
    while flag:
        for b in range(m):
            if dup_b[b] in dup_a[b+a]:
                if b == 0:
                    index = dup_a[a].index(dup_b[0])
                current_index = dup_a[b+a].index(dup_b[b])
                if current_index != index:                
                    if current_index > index:
                        for line in dup_a:
                            del line[:current_index]
                        break
                    else:
                        for line in dup_a:
                            del line[:index]
                        break
            else:   # if not substring in string.
                flag = False
                break

        else: # if not for loop broken.
            ans = "Yes"
            break
        

print(ans)

### FIXED CODE ###

n, m = [int(x) for x in input().split()]
img_a = []
img_b = []

for i in range(n):
    img_a.append(input())

for i in range(m):
    img_b.append(input())

ans = "No"
for a in range(n - m + 1):
    border = 0
    flag = True
    while flag:
        for b in range(m):
            if img_b[b] in img_a[b+a][border:]:
                if b == 0:
                    index = img_a[a].index(img_b[0], border)
                current_index = img_a[b+a].index(img_b[b], border)
                if current_index == index:
                    continue
                elif current_index > index:
                    border = current_index
                    break
                else:
                    border = index
                    break
            else:   # if not substring in string.
                flag = False
                break

        else: # if not loop broken.
            ans = "Yes"
            break
        

print(ans)
import numpy as np
s=input().split()
l=[int(s[i]) for i in range(4)]
v1=np.array([l[0],l[1]])
v2=np.array([l[2],l[3]])
v=v2-v1
A=np.array([[0,-1],[1,0]])
v3=v2+np.dot(A,v)
v=v3-v2
v4=v3+np.dot(A,v)
print(v3[0],v3[1],v4[0],v4[1])

### FIXED CODE ###

import numpy as np
s=input().split()
l=[int(s[i]) for i in range(4)]
v1=np.array([l[0],l[1]])
v2=np.array([l[2],l[3]])
v=v2-v1
A=np.array([[0,-1],[1,0]])
v3=v2+np.dot(A,v)
v=v3-v2
v4=v3+np.dot(A,v)
print(v3[0],v3[1],v4[0],v4[1])
num = int(input())
if num >= 2:
  input_list = [int(i) for i in input().split()] 
  sorted_list = sorted(input_list)

  count = 0
  for input, sort in zip(input_list, sorted_list):
    if input != sort:
      count += 1

  if count < 2:
    print('YES')
  else:
    print('NO')
print('NO')


### FIXED CODE ###

a, b = (int(i) for i in input().split()) 
if a == 0 or b > 10**9 or b == 0 or a == b:
  print('IMPOSSIBLE')
  
elif (a + b) % 2 != 0:
  print('IMPOSSIBLE')
else:
  x = (a + b) / 2
  print(int(x))
n, q = map(int, input().split())
s = input()
dic = {}
t_list = []
d_list = []

for i in range(q):
    t, d = input().split()
    t_list.append(t)
    if d == 'L':
        d_list.append(-1)
    else:
        d_list.append(1)


def find_pos(left, right):
    return left + (right - left - 1) // 2


def calc(sites, ts, ds, _n, _q):
    def check(idx):
        num = idx
        for j in range(_q):
            site = sites[num]
            if ts[j] == site:
                num += ds[j]
            if num < 0:
                return False
        return True

    def func(left, right):
        assert left > -1
        assert right < _n + 1
        if right - left == 1:
            if check(left):
                return left
            else:
                return right
        pos = find_pos(left, right)
        if check(pos):
            return func(left, pos + 1)
        else:
            return func(pos + 1, right)
    return func


f1 = calc(s, t_list, d_list, n, q)
f2 = calc(s[::-1], t_list, [-i*1 for i in d_list], n, q)
print(n - f1(0, n) - f2(0, n))


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
dic = {}
t_list = []
d_list = []

for i in range(q):
    t, d = input().split()
    t_list.append(t)
    if d == 'L':
        d_list.append(-1)
    else:
        d_list.append(1)


def find_pos(left, right):
    return left + (right - left - 1) // 2


def calc(sites, ts, ds):
    def check(idx):
        num = idx
        for j in range(q):
            site = sites[num]
            if ts[j] == site:
                num += ds[j]
            if num < 0:
                return -1
            if num > n - 1:
                return 1
        return 0

    def func(left, right):
        assert left > -1
        assert right < n + 1
        if right - left == 1:
            if check(left) > -1:
                return left
            else:
                return right
        pos = find_pos(left, right)
        if check(pos) > -1:
            return func(left, pos + 1)
        else:
            return func(pos + 1, right)
    return func


f1 = calc(s, t_list, d_list)
f2 = calc(s[::-1], t_list, [-i*1 for i in d_list])
print(n - f1(0, n) - f2(0, n))
if age >= 13 :
    return money
else if age > 5 :
    return money / 2
else:
    return 0

### FIXED CODE ###

A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))
if (__name__ == '__main__'):
    n = int(input())
    a = [0]
    b = [0]
    c = [0]
    aa = input().strip().split()
    for i in range(n):
        a.append(int(aa[i]))
    aa = input().strip().split()
        for i in range(n):
            a.append(int(aa[i]))
    bb = input().strip().split()
        for i in range(n):
            b.append(int(bb[i]))
    c = input().strip().split()
        for i in range(n-1):
            c.append(int(cc[i]))

    sum = b[a[1]]
    lastmenu = a[1]

    for i in range(2, n+1):
        sum = sum + b[a[i]]
        if (a[i] == lastmenu+1):
            sum = sum + c[lastmenu]
       lastmenu = a[i]

    print(sum)
    

### FIXED CODE ###

if (__name__ == '__main__'):
    n = int(input())
    
    a = [0]
    b = [0]
    c = [0]

    aa = input().strip().split()
    for i in range(n):
        a.append(int(aa[i]))
    bb = input().strip().split()
    for i in range(n):
        b.append(int(bb[i]))
    cc = input().strip().split()
    for i in range(n-1):
        c.append(int(cc[i]))

    sum = b[a[1]]
    lastmenu = a[1]

    for i in range(2, n+1):
        sum = sum + b[a[i]]
        if (a[i] == lastmenu+1):
            sum = sum + c[lastmenu]
        lastmenu = a[i]

    print(sum)
import numpy as np
import math

s = input()[::-1]
length = len(s)
a = np.zeros(length, dtype=int)
d = np.zeros(length, dtype=int)

for i in range(length):
    a[i] = int(s[i]) * pow(10, i) % 2019
d[0] = a[0]

for i in range(length-1):
    d[i+1] = (d[i] + a[i+1]) % 2019
    
x = np.unique(d, return_counts=True)[1]
x = x[np.where(x > 1)]

print(int(sum([math.factorial(x[i]) for i in range(x.shape[0])]) / 2) + d.shape[0] - np.count_nonzero(d))

### FIXED CODE ###

import numpy as np

s = input()[::-1]
length = len(s)
a = np.zeros(length, dtype=int)
d = np.zeros(length, dtype=int)
ans = np.zeros(2019, dtype=int)
x = 10

a[0] = int(s[0])
d[0] = a[0]
ans[d[0]] += 1

for i in range(1, length):
    a[i] = int(s[i]) * x % 2019
    d[i] = (d[i-1] + a[i]) % 2019
    ans[d[i]] += 1
    x = x * 10 % 2019

ans_c = ans[np.nonzero(ans)]

print(int(sum([ans_c[i] * (ans_c[i]-1) for i in range(ans_c.shape[0])]) / 2) + ans[0])
for i in range(7):
    if 2**i> n:
        break

print(2**(i-1))  

### FIXED CODE ###

n = int(input())

for i in range(8):
    if 2**i> n:
        break

print(2**(i-1))
n=int(input())
l=sorted(list(map(int,input().split())))
count=0
def nibutan(s,g,num):
  while True:
    low=s
    high=g-1
    mid=(low+high)/2
    num1=l[mid]
    if num<=l[mid] and l[mid-1]<num:
      return mid
    elif l[mid-1]>num:
      low=mid+1
    elif l[mid]<num:
      high=mid-1
    else:
      return mid-1    
for i in range(n-2):
  for j in range(i+1,n-1):
    if l[i]+l[j]<=l[n-1]:
      pass
    else:
      

### FIXED CODE ###

import bisect
n=int(input())
l=sorted(list(map(int,input().split())))
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    index=bisect.bisect_left(l,l[i]+l[j])
    count+=index-j-1
print(count)
count=0
while True:
    count+=1
    a=input()
    if a==0:
        break
    else:
        print("Case "+str(count)+": "+str(a))


### FIXED CODE ###

count=1
while True:
    a=input()
    a=int(a)
    if a==0:
        break
    print("Case {}: {}".format(count,a))
    count+=1
def run(a):
    return a[0] * a[1] // 2


def main():
    a = map(int, input().split())
    print(run(a))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def run(a):
    return a[0] * a[1] // 2


def main():
    a = list(map(int, input().split()))
    print(run(a))


if __name__ == '__main__':
    main()
a, b = (int(x)
        for x in input().split)
print(a*b)

### FIXED CODE ###

a, b = (int(x)
        for x in input().split())
print(a*b)
a=int(input())
b=int(input())
h=int(input())
print(((a+b)*h)//2))


### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())

print(((a+b)*h)//2)
n = int(input())
li = list(map(int,input().split()))
cnt = 0
i = -1
count = []
while True:

    if i == -n:
        break
    if li[i] <= li[i-1]:
        cnt+=1
    else:
        count.append(cnt)
        cnt = 0
    i = i - 1
    if max(count)>= n//2:
        break
print(max(count))

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if li[i]>=li[i+1]:
        cnt+=1
    else:
        if cnt>ans:
            ans = cnt
        cnt = 0
if cnt>ans:
    ans = cnt
print(ans)
A,B=map(int(input().split())
c=A
x=1
while c>B:
        c=c-1+A
        x+=1
print(x)


### FIXED CODE ###

S=input()
T=input()
m=0
for i in range(3):
    if S[i]==T[i]:
        m+=1
print(m)
N, A, B, C, D = map(int, input().split())
mod = 7 + 10 ** 9

fact = [1] * (N+1)
frev = [1] * (N+1)
for i in range(1, N+1):
    temp = fact[i] = (fact[i-1] * i) % mod
    frev[i] = pow(temp, mod-2, mod)

def P(n, r):
    ans = fact[n] * frev[n-r]
    return ans % mod

if A * C > N: print(0)
else:
    DP = [[0 for j in range(N+1)] for i in range(N+1)]
    for i in range(N+1): DP[i][0] = 1
    DP[A][A * C] = (P(N, A*C) * (frev[A] ** C) * frev[C]) % mod
    for i in range(A, B+1):
        for j in range(N+1):
           if i == A and j == A * C: continue
           DP[i][j] = DP[i-1][j]
           for k in range(C, D + 1):
               if j - i * k < 0: break
               temp = (P(N-j+i*k, i*k) * (frev[i]**k) * frev[k]) % mod
               DP[i][j] += (temp * DP[i-1][j-i*k]) % mod
               DP[i][j] %= mod

print(DP[B][N])

### FIXED CODE ###

N, A, B, C, D = map(int, input().split())
mod = 7 + 10 ** 9

fact = [1] * (N+1)
frev = [1] * (N+1)
for i in range(1, N+1):
    temp = fact[i] = (fact[i-1] * i) % mod
    frev[i] = pow(temp, mod-2, mod)

def P(n, r):
    return (fact[n] * frev[n-r]) % mod

DP = [[0 for j in range(N+1)] for i in range(N+1)]
for i in range(N+1): DP[i][0] = 1
for i in range(A, B+1):
    revi = frev[i]
    for j in range(1, N+1):
       dpij = 0 + DP[i-1][j]
       for k in range(C, D + 1):
           if j - i * k < 0: break
           temp = (P(N-j+i*k, i*k) * pow(revi, k, mod) * frev[k]) % mod
           dpij += (temp * DP[i-1][j-i*k]) % mod
       DP[i][j] = dpij % mod

print(DP[B][N])