Harryxun/stf_run huggingface dataset:
n = int(input())
P_list = list(map(int,(input().split(" "))))
#print(P_list)
count = 0
i = 0
for i in range(n-2):
    if P_list[i] > P_list[i+1] > P_list[i+2] or P_list[i] < P_list[i+1] < P_list[i+2]:
        count = count + 1

#print(n)
#print(P_list)
print(count)


### FIXED CODE ###

#４文字の文字列Sが二種類で2回ずつ現れる判定
S = input()
S_list = set(list(S))
#print(S_list)




if len(S_list) == 2:
    print("Yes")
else:
    print("No")
import math
S=int(input())

hour = math.floor(S/3600)
min = math.floor((S-hour*3600)/60)
sec =  S - h*3600 - m*60

print(str(hour)+":"+str(min)+":"+str(sec))

### FIXED CODE ###

import math
S=int(input())

hour = math.floor(S/3600)
min = math.floor((S-hour*3600)/60)
sec =  S - hour*3600 - min*60

print(str(hour)+":"+str(min)+":"+str(sec))
import math
n,k = map(int,input().split())
x = n//k
if(n<k):
    x = k//n
    print(min(abs(k*x-n),abs(k*(x+1)-n)))
else:
    print(min(abs(k*x-n),abs(k*(x+1)-n)))


### FIXED CODE ###

n,k = map(int,input().split())
print(min(n%k,abs(k-n%k)))
class edge():
    def __init__(self,_to,_cost):
        self.to = _to;
        self.cost = _cost;

N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a,b,c = list(map(int,input().split()))
    a = a - 1
    b = b - 1
    tree[a].append(edge(b,c))
    tree[b].append(edge(a,c))
Q,K = list(map(int,input().split()))
K = K - 1
depth = [None]*N

def DFS(v,p,d):
    depth[v] = d
    for e in tree[v]:
        if e.to == p:
            continue
        DFS(e.to, v, d + e.cost)
DFS(K,-1,0)

for _ in range(Q):
    x,y = list(map(int, input().split()))
    x = x - 1
    y = y - 1
    print(depth[x] + depth[y])


### FIXED CODE ###

import sys;sys.setrecursionlimit(int(1e7))

class edge():
    def __init__(self,_to,_cost):
        self.to = _to;
        self.cost = _cost;

N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a,b,c = map(int,input().split())
    a = a - 1
    b = b - 1
    tree[a].append(edge(b,c))
    tree[b].append(edge(a,c))
Q,K = map(int,input().split())
K = K - 1
depth = [None]*N

def DFS(v,p,d):
    depth[v] = d
    for e in tree[v]:
        if e.to == p:
            continue
        DFS(e.to, v, d + e.cost)
DFS(K,-1,0)

for _ in range(Q):
    x,y = map(int, input().split())
    x = x - 1
    y = y - 1
    print(depth[x] + depth[y])
N = int(input())
a_list = list(map(int, input().split()))

for i in range(N-1):
    if a_list[i] <0 and a_list[i+1] < 0:
       a_list[i] *= -1
       a_list[i+1] *= -1

for i in range(N-1):
    if a_list[i] + a_list[i+1] < 0:
       a_list[i] *= -1
       a_list[i+1] *= -1

ans = sum(a_list)

min_list = []
for i in range(N):
    if a_list[i] < 0:
        min_list.append(a_list[i])

if len(min_list) % 2 == 0:
    abc = sum(min_list)
    abc *= -1
    print(ans + 2*abc)

if len(min_list) % 2 == 1 and len(min_list) != 1:
    abc.sort()
    min_list = min_list[:-1]
    abc = sum(min_list)
    abc *= -1
    print(ans + 2*abc) 


### FIXED CODE ###

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

for i in range(N-1):
    if a_list[i] <0 and a_list[i+1] < 0:
       a_list[i] *= -1
       a_list[i+1] *= -1

counter = 0
min_list = []
for i in range(N):
    if a_list[i] < 0:
        counter += 1
        min_list.append(a_list[i])

if counter % 2 == 0:
    abc = sum(min_list)
    abc *= -1
    ans = sum(a_list)
    print(ans + 2*abc)

if counter % 2 == 1:
    for i in range(N):
        if a_list[i] < 0:
            a_list[i] *= -1
    min_mun = min(a_list)
    ans = sum(a_list) - 2*min_mun
    print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

MOD = 998244353

N,*A = map(int,read().split())

T = A.count(1)
if T == 0:
    print(0)
    exit()
if T == 1:
    answer = 1 if len(set(A)) == N else 0
    print(answer)
    exit()
if T == N:
    answer = 1
    for n in range(1,N+1):
        answer *= n
        answer %= MOD
    print(answer)
    exit()

n = A.index(1)
while A[n-1] == 1:
    n -= 1
A = A[n:] + A[:n]

# assert len(A) == N and A[0] == 1 and A[-1] != 1

L = [0] * (N+1)
R = [-1] * (N+1)
ctr = [0] * (N+1)
prev = 0
for i,x in enumerate(A):
    ctr[x] += 1
    R[x] = i
    if prev != x:
        L[x] = i
        prev = x

if any(y - x + 1 != z for x,y,z in zip(L,R,ctr)):
    print(0)
    exit()

raise Exception

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from operator import itemgetter

MOD = 998244353

N,*A = map(int,read().split())

T = A.count(1)
if T == 0:
    print(0)
    exit()
if T == 1:
    answer = 1 if len(set(A)) == N else 0
    print(answer)
    exit()
if T == N:
    answer = 1
    for n in range(1,N+1):
        answer *= n
        answer %= MOD
    print(answer)
    exit()

n = A.index(1)
while A[n-1] == 1:
    n -= 1
A = A[n:] + A[:n]

# assert len(A) == N and A[0] == 1 and A[-1] != 1

L = [0] * (N+1)
R = [-1] * (N+1)
ctr = [0] * (N+1)
nums = []
prev = 0
for i,x in enumerate(A):
    ctr[x] += 1
    R[x] = i
    if prev != x:
        nums.append(x)
        L[x] = i
        prev = x

if any(y - x + 1 != z for x,y,z in zip(L,R,ctr)):
    print(0)
    exit()
if any(x > T for x in ctr[2:]):
    print(0)
    exit()

free = [0] * (N+1) # ある数値を書き込んだ時点で、死亡確定になってるマス数
answer = 1
for x,y,z in zip(nums,nums[1:],nums[2:]+[1]):
    if x > y < z:
        if ctr[y] != T:
            answer = 0
            break
    elif x < y < z:
        free[y] += ctr[y] - 1
    elif x > y > z:
        free[y] += ctr[y] - 1
    else:
        # x < y > z
        answer *= (T + 1 - ctr[y])
        answer %= MOD
        free[y] += ctr[y] + T - 2

f = 0
for n in range(1,N+1):
    if ctr[n] >= 1:
        f += free[n]
        continue
    answer *= f
    answer %= MOD
    f -= 1

print(answer)
N, X = map(int, input().split())
a,p=[1],[1] for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
deff(N,X): #X<=0やX>a_Nを許容し解説本文から簡略化 if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])
print(f(N, X))

### FIXED CODE ###

N, X = map(int, input().split())
a,p=[1],[1] 
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
def f(N,X): #X<=0やX>a_Nを許容し解説本文から簡略化
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])
print(f(N, X))
import sys

import numpy as np

MOD = 998244353

def main():
    N, S = map(int, input().split())
    X = [int(x) for x in sys.stdin.readline().split()]

    # dp = np.zeros((N+1)*(S+1), dtype=np.int).reshape((N+1),(S+1))
    dp = [[0 for _ in range(S+1)] for _ in range(N+1)]

    dp[0][0] = 1

    for i in range(N):
        xi = X[i]
        # xi を U に加えない場合
        for j in range(S+1):
            dp[i+1][j] += dp[i][j]*2  # T に加える／加えない
            dp[i+1][j] %= MOD
            # xi を U に加える場合
            if j+xi > S: continue
            dp[i+1][j+xi] += dp[i][j]
            dp[i+1][j+xi] %= MOD

    print(dp[N][S] % MOD)

main()

### FIXED CODE ###

import sys

MOD = 998244353

def main():
    N, S = map(int, input().split())
    X = [int(x) for x in sys.stdin.readline().split()]

    # dp = np.zeros((N+1)*(S+1), dtype=np.int).reshape((N+1),(S+1))
    dp = [[0 for _ in range(S+1)] for _ in range(N+1)]

    dp[0][0] = 1

    for i in range(N):
        xi = X[i]
        # xi を U に加えない場合
        for j in range(S+1):
            dp[i+1][j] += dp[i][j]*2  # T に加える／加えない
            dp[i+1][j] %= MOD
            # xi を U に加える場合
            if j+xi > S: continue
            dp[i+1][j+xi] += dp[i][j]
            dp[i+1][j+xi] %= MOD

    print(dp[N][S] % MOD)

main()
A=int(input())
B=int(input())
number=[1,2,3]
del number[A-1]
del number[B-1]
print(number[0])

### FIXED CODE ###

A=int(input())
B=int(input())
print(6-A-B)
n.m=map(int,input().split())
if 500*n>=m:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n,m=map(int,input().split())
if 500*n >= m:
    print("Yes")
else:
    print("No")
def main():
    X,Y = map(int,input())
    if X%Y==0:
        print(-1)
    else:
        for i in range(1,10**8):
            if (X*i)%Y != 0:
                print(X*i)
                exit()
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    X,Y = map(int,input().split())
    if X%Y==0:
        print(-1)
    else:
        for i in range(1,10**8):
            if (X*i)%Y != 0:
                print(X*i)
                exit()
if __name__ == "__main__":
    main()
from scipy.special import comb

N, K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
MOD = 10**9+7

    
maxsum = 0
minsum = 0
for i,a in enumerate(A):
    maxsum += comb(i,K-1)*a
    maxsum %= MOD
    minsum += comb(N-i-1,K-1)*a
    minsum %= MOD
ans = (maxsum-minsum)%MOD

print(ans)

### FIXED CODE ###

N, K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
MOD = 10**9+7

#階乗テーブルと逆元テーブルを作成する
fac = [0]*(N+1) # 階乗テーブル
fac[0] = fac[1] = 1
inv = [0]*(N+1) # 逆元テーブル
inv[1] = 1
facinv = [0]*(N+1) # 階乗の逆元テーブル
facinv[0] = facinv[1] = 1
for i in range(2,N+1):
    fac[i] = fac[i-1]*i%MOD
    inv[i] = MOD - inv[MOD%i] * (MOD//i) % MOD
    facinv[i] = facinv[i-1] * inv[i] % MOD

def nCr(n, r, mod):
    if n < r or n < 0 or r < 0:return 0
    #毎回MODで割ってもいい。
    else:return fac[n] * (facinv[r] * facinv[n-r] % mod) % mod
    

# 各要素が最大値、最小値として何回使われるか考える
maxsum = 0
minsum = 0
for i,a in enumerate(A):
    maxsum += nCr(i, K-1, MOD)*a
    maxsum %= MOD
    minsum += nCr(N-i-1, K-1, MOD)*a
    minsum %= MOD
ans = (maxsum-minsum)%MOD

print(ans)
n = int(input())
s = n > 1000 if 'D' else 'C'
print('AB' + s + str(n % 1000)) 

### FIXED CODE ###

s = print('AB' + ('D' if int(input()) > 999 else 'C'))
n = int(input())
h = list(map(int, input().split()))
h.reverse()
l =[]
j = 0
while j < n-1:
    count = 0
    i = j
    while h[i] <= h[i+1]:
        count+=1
        if i+1 ==n-1:
            break
        i+=1
    j += count+1
    l.append(count)
print(max(l))


### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
l = 0
j = 0
while j < n-1:
    count = 0
    i = j
    while h[i] >= h[i+1]:
        count+=1
        if i+1 == n-1:
            break
        i+=1
    if l < count:
        l =count
    j += count+1

print(l)
import sys
import math
import itertools

n=int(input())
if n==5 or n==7 or n==3
	print("Yes")
else :
	print("No")

### FIXED CODE ###

import sys
import math
import itertools

n=int(input())
if n==5 or n==7 or n==3 :
	print("YES")
else :
	print("NO")
n,h = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]
a,b = 0,[]
for j in x:
	if a < j[0]: a = j[0]
	b.append(j[1])
num = 0
for j2 in b:
	if j2 >= a:
		h -= j2
		num +=1
if h%a==0: answer = (h-h%a)//a + num
else: answer = (h-h%a)//a + num + 1
print(answer)


### FIXED CODE ###

s = input()
print(s[:3] + "8" + s[4:])
n = int(input())
s,d = map(int,input().split())

c = 0
for i in range(s,d+1):
  if i % s == 0:
  	c = c + 1


if c != 0:
 	print("OK"
else:
  	print("NG")

### FIXED CODE ###

n = int(input())
s,d = map(int,input().split())

c = 0
for i in range(s,d+1):
  if i % n == 0:
  	c = c + 1
  else:
    c = c
    
if c != 0:
 	print("OK")
else:
  	print("NG")
import numpy as np
N,M = map(int,input().split())
S = input()
T = input()

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
 

def lcm(a, b):
	return a * b // gcd (a, b)

L = N*M // gcd(N,M)

X = np.zeros(L, dtype=np.str)

for i in range(N):
    X[i*(L//N)] = S[i]

for i in range(M):
    if X[i*(L//M)] == '':
        X[i*(L//M)] = T[i]
    elif X[i*(L//M)] != T[i]:
        print('-1')
        exit()

print(L)

### FIXED CODE ###

N,M = map(int,input().split())
S = input()
T = input()

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

L = N*M // gcd(N,M)

n = L // N
m = L // M

list_n = [i for i in range(0,L,n)]
list_m = [i for i in range(0,L,m)]

list_common = sorted(list(set(list_n) & set(list_m)))

for i in list_common:
    if i == 0:
        if S[0] != T[0]:
            print('-1')
            exit()
    elif S[i//n] != T[i//m]:
        print('-1')
        exit()

print(L)
def k_sub():
    s=input()
    k=int(input())
    a=[]
    for i in range(1,len(s)+1):
        for j in range(len(s)+1-i):
            a.append(s[j:j+i])
    a.sort()
    print(a[k])

if __name__=='__main__':
    k_sub()

### FIXED CODE ###

s=input()
k=int(input())

a=sorted({s[i:i+j+1] for i in range(len(s)) for j in range(k)})[k-1]
print(a)
a, b = list(map(int, imput().split()))
ans = 0
if b == 1:
  print(ans)
else:
  while a < b:
    ans += 1
    a += a
  print(ans)
 
 

### FIXED CODE ###

a, b = list(map(int, input().split()))
ans = 0
count = 1
if b != 1:
    while count < b:
        count += a - 1
        ans += 1
print(ans)
n = int(input())
a = []
cur = 1
while cur <= n:
  a.append(cur)
  cur *= 2
print(sum(cur))

### FIXED CODE ###

n = int(input())
a = []
cur = 1
while cur <= n:
  a.append(cur)
  cur *= 2
print(sum(a))
import math

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

if K == 0:
	print(sum(A))

else:
	d = math.floor(math.log2(K)) + 1
	t = [0]*d

	for a in A:
		for i in range(d):
			if a == 0:
				break
			else:
				t[i] += a & 1
				a = a >> 1

	t = list(map(lambda x:N-2*x, t))


	w = []
	v = []

	for i in range(len(t)):
		if t[i] > 0:
			w.append(int(math.pow(2, i)))
			v.append(t[i])

	n = len(w)
	m = [[0]*(K+1) for i in range(n+1)]

	for i in range(1, n+1):
		for j in range(K+1):
			if w[i-1] <= j:
				remaining = j - w[i-1]
				m[i][j] = max(m[i-1][j] ,m[i-1][remaining] + w[i-1]*v[i-1])
			else:
				m[i][j] = m[i-1][j]

	print(sum(A)+m[n][K])

### FIXED CODE ###

import operator

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

k = [((K+1)&(1<<i))>>i for i in range(40)]

m = [0]*40
for i in range(40):
	c = 0
	for a in A:
		c += (a&(1<<i))>>i
	
	if N < 2*c:
		m[i] = 0
	else:
		m[i] = 1

f = 0
b = [1<<i for i in range(40)]
for i in range(40):
	if k[i]==1:
		x = sum(map(operator.mul, m[:i]+[0]+k[i+1:], b))
		f = max(f, sum([x^a for a in A]))

print(f)
n = int( input() )
#print( n )

d1 = [ 0 ] * n
d2 = [ 0 ] * n
#print( d1, d2 )

for i in range( n ):
    d1[ i ], d2[ i ] = map( int, input().split() )

#print( d1, d2 )


for i in range( n-2 ):
    if d1[ i ] == d2[ i ]:
        if d1[ i+1 ] == d2[ i+1 ]:
            if d1[ i+2 ] == d2[ i+2 ]:
                exit( "Yes" )

print( "No" )


### FIXED CODE ###

n = int( input() )
#print( n )

cnt = 0
ans = "No"
for i in range( n ):
    a, b = map( int, input().split() )
    if a == b:
        cnt = cnt + 1
    else:
        cnt = 0

    if cnt == 3:
        ans = "Yes"


print( ans )
mport itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    if (i[0] + i[1]) > i[2]:
        count += 1

print(count)

### FIXED CODE ###

import itertools as it


N = int(input()) - 1
s = list(map(int, input().split()))
count = 0

c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    maximum = max(listed)
    listed.remove(maximum)
    if (listed[0] + listed[1]) > maximum:
        count += 1

print(count)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:16:42 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    s_a = input()
    s_b = input()
    s_c = input()
    s_a = [s for s in s_a if s is not 'a']
    s_b = [s for s in s_b if s is not 'b']
    s_c = [s for s in s_c if s is not 'c']
    turn = s_a.pop(0)
    ans = -1
    while 1:
        if turn == 'a' and s_a:
            turn = s_a.pop(0)
        elif turn == 'b' and s_b:
            turn = s_b.pop(0)
        elif turn == 'c' and s_c:
            turn = s_c.pop(0)
        elif turn == 'a' and not s_a:
            ans = 0
            break
        elif turn == 'b' and not s_b:
            ans = 1
            break
        elif turn == 'c' and not s_c:
            ans = 2
            break
    if ans == 0:
        print("A")
    elif ans == 1:
        print("B")
    else:
        print("C")




if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-07-16 23:00:42 +0900
# LastModified: 2020-07-16 23:23:14 +0900
#
from collections import deque


def main():
    s_a = input()
    s_b = input()
    s_c = input()
    s_a = [s for s in s_a if s != 'a']
    s_b = [s for s in s_b if s != 'b']
    s_c = [s for s in s_c if s != 'c']
    s_a = deque(s_a)
    s_b = deque(s_b)
    s_c = deque(s_c)
    if not s_a:
        print("A")
        return
    turn = s_a.popleft()
    ans = -1
    while 1:
        if turn == 'a' and s_a:
            turn = s_a.popleft()
        elif turn == 'b' and s_b:
            turn = s_b.popleft()
        elif turn == 'c' and s_c:
            turn = s_c.popleft()
        elif turn == 'a' and not s_a:
            ans = 0
            break
        elif turn == 'b' and not s_b:
            ans = 1
            break
        elif turn == 'c' and not s_c:
            ans = 2
            break
    if ans == 0:
        print("A")
    elif ans == 1:
        print("B")
    else:
        print("C")
    return




if __name__ == "__main__":
    main()
S = (int(input))
h = m / 60
m = s / 60
s = m * 60
print(h, m, s, sep = ':')

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60
print(h, m, s, sep=':')
#!/usr/bin/python
# -*- coding: utf-8 -*-

# 入力はstringで入る．
# intにしたければ int(input())
# floatで受け取ると 1.0 になる．

# 入力 : N
# 入力 : A1 A2 ... AN
N = int(input())
A = list(map(int, input().split()))

Number = []
PosNum = []
NegNum = []

for i in range(N):
    Number.append(A.count(i+1))
    PosNum.append(Number[i]*(Number[i]-1)/2)
    NegNum.append(- Number[A[i]-1]*(Number[A[i]-1]-1)/2 + (Number[A[i]-1]-1)*(Number[A[i]-1]-2)/2)

Total = sum(PosNum)

for k in range(N):
    print(int(Total + NegNum[k]))


### FIXED CODE ###


import collections

# 入力 : N
# 入力 : A1 A2 ... AN
N = int(input())
A = list(map(int, input().split()))

C = collections.Counter(A)

Total = sum([i*(i-1)/2 for i in C.values()])

for Ak in A:
    print(int(Total - C[Ak]+1))
N = input()
  
if N < 1000:
  out = 1000 - N
elif N % 1000 < 500:
  out = N % 1000
else:
  out = 1000 - N % 1000

print(out)

### FIXED CODE ###

N = int(input())
if N % 1000 == 0:
  print(0)
else:
  print(1000 - N % 1000)
a = input()
b = int(a[0]) + int(a[2])
c = int(a[0]) - int(a[2])
d = int(a[0]) * int(a[2])
if b >= c and b >= d:
  print(b)
elif c >= b and c >= d:
  print(c)
else:
  print(d)

### FIXED CODE ###

a,b = map(int,input().split())
print(max(a+b,a-b,a*b))
t=list(input())
if t[-1]=='?':
    t[-1]='D'
indexes = [i for i, x in enumerate(t) if x == '?']
for i in range(len(indexes)-1,0,-1):
    a=indexes[i]
    if t[a-1]=='P':
        t[a]='D'
    else:
        if t[a+1]=='D':
            t[a]='P'
        else:
            t[a]='D'
a=t.index('?')
if t[a-1]=='P':
    t[a]='D'
else:
    if t[a+1]=='D':
        t[a]='P'
    else:
        t[a]='D'   
print(''.join(t))

### FIXED CODE ###

t=list(input())
if t[-1]=='?':
    t[-1]='D'
indexes = [i for i, x in enumerate(t) if x == '?']
for i in range(len(indexes)-1,0,-1):
    a=indexes[i]
    if t[a-1]=='P':
        t[a]='D'
    else:
        if t[a+1]=='D':
            t[a]='P'
        else:
            t[a]='D'
if '?'in t:
    a=t.index('?')
    if t[a-1]=='P':
        t[a]='D'
    else:
        if t[a+1]=='D':
            t[a]='P'
        else:
            t[a]='D'   
print(''.join(t))
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef vector <int> vi;
typedef vector < vector <int> > vvi;
const int HUGEI = 2147483647;  // (1 << 31) - 1
const ll HUGEL = 9223372036854775807;  // (1 << 63) - 1
const string ABC = "abcdefghijklmnopqrstuvwxyz";

int main(void) {
    return 0;
}


### FIXED CODE ###

#!/usr/bin/env python3

l1 = input()
l2 = input()
l3 = input()

s = l1[0] + l2[1] + l3[2]
print(s)
def warshall_floyd(d, n):
    # d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


def read_input():
    n, m = map(int, input().split())

    edges = []
    for i in range(m):
        a, b, c = map(int, input().split())
        edges.append((a - 1, b - 1, c))

    return n, m, edges

def submit():
    n, m, edges = read_input()

    # 全ノード間の最短経路を求める
    d = [[float('inf') for _ in range(n)] for _ in range(n)]

    for edge in edges:
        d[edge[0]][edge[1]] = edge[2]
        d[edge[1]][edge[0]] = edge[2]

    for i in range(n):
        d[i][i] = 0

    d = warshall_floyd(d, n)

    # 各edgeについていずれかの2点間の最短経路に含まれうるか確認する
    edge_inuse = [0 for _ in range(n)]
    for e, edge in enumerate(edges):
        for i in range(n):
            for j in range(n):
                dist1 = d[i][j]
                dist2 = d[i][edge[0]] + edge[2] + d[edge[1]][j]

                if dist1 == dist2:
                    edge_inuse[e] = 1
                    break

            if edge_inuse[e] == 1:
                break

    print(m - sum(edge_inuse))
    return


if __name__ == '__main__':
    submit()


### FIXED CODE ###



def warshall_floyd(d, n):
    # d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


def read_input():
    n, m = map(int, input().split())

    edges = []
    for i in range(m):
        a, b, c = map(int, input().split())
        edges.append((a - 1, b - 1, c))

    return n, m, edges

def submit():
    n, m, edges = read_input()

    # 全ノード間の最短経路を求める
    d = [[float('inf') for _ in range(n)] for _ in range(n)]

    for edge in edges:
        d[edge[0]][edge[1]] = edge[2]
        d[edge[1]][edge[0]] = edge[2]

    for i in range(n):
        d[i][i] = 0

    d = warshall_floyd(d, n)

    # 各edgeについていずれかの2点間の最短経路に含まれうるか確認する
    edge_inuse = [0 for _ in range(m)]
    for e, edge in enumerate(edges):
        for i in range(n):
            for j in range(n):
                dist1 = d[i][j]
                dist2 = d[i][edge[0]] + edge[2] + d[edge[1]][j]

                if dist1 == dist2:
                    edge_inuse[e] = 1
                    break

            if edge_inuse[e] == 1:
                break

    print(m - sum(edge_inuse))
    return


if __name__ == '__main__':
    submit()
import numpy as np
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
score = np.array([int(K) for __ in range(N)])
score_1 = np.array([1 for _mi in range(N)])

for i in range(Q):
    score -= score_1
    score[A[i]-1] = score[A[i]-1]+1
for k in range(N):
    if score[k] <= 0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

n, k, q = map(int, input().split())
p = k-q
l = [p]*n
for i in range(q):
    a = int(input())
    l[a-1] += 1
for k in range(n):
    print("Yes" if l[k]>0 else "No")
n = int(input()) #number of meals

payment = 0
while (n % 15 >= 1 ){
  payment = 800*15 + 200
  n -= 15
}
payment += n*800

print(payment)

### FIXED CODE ###

n = int(input()) #number of meals
print(n*800 - n//15*200)