Harryxun/stf_run huggingface dataset:
n=int(input())
a=[n]
for i in range(0,n,1):
    a[i]=int(input())
    kei=kei+a[i]

a.sort(reverse=True)
kei=kei-a[0]/2
print("%d",kei)

### FIXED CODE ###

n=int(input())
a=[0]*n
kei=0
for i in range(0,n,1):
    a[i]=int(input())
    kei=kei+a[i]

a.sort(reverse=True)
kei=kei-a[0]//2
print(kei)
N=int(input())
A=list(map(int,input().split()))
box=[]

for i in range(N):
  box.insert(i,A.index(i+1)+1)
print(join(box))

### FIXED CODE ###

N=int(input())
A=tuple(map(int,input().split()))

a=[0]*N

for i in range(N):
    a[A[i]-1]=i+1

print(" ".join(map(str,a)))
n=int(input())
a=[int(input()) for i in range(n)]
data=[0]*10**6
ans=0
for i in a:
  data[i-1]+=1
  if data[i-1]%2==0:
    ans-=1
  else:
    ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
a={}
for i in range(n):
  a_=int(input())
  if a_ not in a:
    a[a_]=1
  else:
    a[a_]+=1
ans=0
for i in a:
  if a[i]%2==1:
    ans+=1
print(ans)
import sys

N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def popcount(x: int):
    return bin(x).count("1")


def main():
    N = int(sys.stdin.readline().rstrip())
    X = sys.stdin.readline().rstrip()

    Xdec = int(X, 2)

    # X がゼロなら終了
    if Xdec == 0:
        print(0)
        return

    # 1回目の演算用
    md = X.count("1")
    md_p, md_m = md + 1, md - 1
    tmp_p = Xdec % md_p
    tmp_m = Xdec % md_m

    for i in range(0, N, 1):
        if X[i] == "1":
            x_m = pow(2, (N - 1 - i), md_m)
            tmp = (tmp_m - x_m) % md_m

        if X[i] == "0":
            x_p = pow(2, (N - 1 - i), md_p)
            tmp = (tmp_p + x_p) % md_p

        cnt = 1
        while tmp:

            tmp = tmp % popcount(tmp)
            cnt += 1

        print(cnt)


main()


### FIXED CODE ###

import sys


def popcount(x: int):
    return bin(x).count("1")


def main():
    N = int(sys.stdin.readline().rstrip())
    X = sys.stdin.readline().rstrip()

    Xdec = int(X, 2)

    # 1回目の演算用
    md = popcount(Xdec)
    md_p, md_m = md + 1, md - 1

    tmp_p = Xdec % md_p
    if md_m > 0:
        tmp_m = Xdec % md_m

    for i in range(0, N, 1):
        if X[i] == "1":  # 1->0
            if md_m == 0:
                print(0)
                continue
            x_m = pow(2, (N - 1 - i), md_m)
            tmp = (tmp_m - x_m) % md_m

        if X[i] == "0":  # 0->1
            x_p = pow(2, (N - 1 - i), md_p)
            tmp = (tmp_p + x_p) % md_p

        cnt = 1
        while tmp:

            tmp = tmp % popcount(tmp)
            cnt += 1

        print(cnt)


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

if len(aset) == 1:
  if all(i == 0 for i in a):
    print("Yes")
  else:
    print("No")
elif len(aset) == 2:
  a1, a2 = sorted(aset)
  if a1 == 0:
    if a.count(a1) * 3 == N:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
elif len(aset) == 3:
  a1, a2, a3 = aset
  if a.count(a1) == a.count(a2) == a.count(a3):
    if a1 ^ a2 == a3:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")


### FIXED CODE ###

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

if len(aset) == 1:
  if all(i == 0 for i in a):
    print("Yes")
  else:
    print("No")
elif len(aset) == 2:
  a1, a2 = sorted(aset)
  if a1 == 0:
    if a.count(a1) * 3 == n:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
elif len(aset) == 3:
  a1, a2, a3 = aset
  if a.count(a1) == a.count(a2) == a.count(a3):
    if a1 ^ a2 == a3:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")
x=int(input())
if x == 7 or x == 5 or x == 3:
	print('YES')
else:
	print('NO')p

### FIXED CODE ###

x=int(input())
if x == 7 or x == 5 or x == 3:
	print('YES')
else:
	print('NO')
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new2 = True if s[i] in k else False
    else:
        new1 =True if s[i] in g else False
       
if new2 == True and new1 == True:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']
count =0

for i in range(n):
    if i % 2 ==0:
        if s[i] in k:
            count +=1
    else:
        if s[i] in g:
            count += 1
       
if count == n:
    print("Yes")
else:
    print("No")
def resolve():
    n, k = map(int, input().split())
    mod = 998244353
    dp = [0] * (2*n)
    imos = [0] * (2*n)
    lr = []
    for i in range(k):
        l, r = map(int, input().split())
        lr.append((l, r+1))
    for l, r in lr:
        imos[l] = 1
        imos[r] = -1
    now = 0
    for i in range(1, n):
        now += imos[i]
        now %= mod
        dp[i] = now
        for l, r in lr:
            imos[min(i+l, n+2)] += now
            imos[min(i+r, n+2)] += -1*now
    print(dp[n-1]%mod)


resolve()

### FIXED CODE ###

def resolve():
    n, k = map(int, input().split())
    mod = 998244353
    dp = [0] * (3*n)
    imos = [0] * (3*n)
    lr = []
    for i in range(k):
        l, r = map(int, input().split())
        lr.append((l, r+1))
    for l, r in lr:
        imos[l] += 1
        imos[r] += -1
    for i in range(1, n+1):
        dp[i] = (dp[i-1] + imos[i]) %mod
        for l, r in lr:
            imos[min(i+l, n+2)] += dp[i]
            imos[min(i+r, n+2)] += -1*dp[i]
    print(dp[n-1]%mod)

resolve()
import sys
n=int(input())
if n==2 or n==5:
  print(-1)
  sys.exit()
if n%3==0:
  a=[]
  b=[]
  for j in range(n//3):
    a.append('a')
    a.append('a')
    a.append('.')
    b.append('.')
    b.append('.')
    b.append('a')
  for i in range(n):
    if i%3==0:
      print(''.join(a))
    else:
      print(''.join(b))
  sys.exit()

elif n%4==0:
  a=[]
  b=[]
  c=[]
  d=[]
  for j in range(n//4):
    a.append('a')
    a.append('a')
    a.append('c')
    a.append('d')
    b.append('b')
    b.append('b')
    b.append('c')
    b.append('d')
    c.append('e')
    c.append('f')
    c.append('g')
    c.append('g')
    d.append('e')
    d.append('f')
    d.append('h')
    d.append('h')
  for i in range(n):
    if i%4==0:
      print(''.join(a))
    elif i%4==1:
      print(''.join(b))
    elif i%4==2:
      print(''.join(c))
    elif i%4==3:
      print(''.join(d))
  sys.exit()

for i in range(n//3):
   if (n-i*3)%4==0:
     x=i
     y=(n-i*3)//4
     break

ans=[]
for i in range(n):
  ans1=['.']*n
  ans.append(ans1)

for i in range(x):
  ans[i*3][i*3]='a'
  ans[i*3][i*3+1]='b'
  ans[i*3][i*3+2]='b'
  ans[i*3+1][i*3]='a'
  ans[i*3+1][i*3+2]='a'
  ans[i*3+2][i*3]='b'
  ans[i*3+2][i*3+1]='b'
  ans[i*3+2][i*3+2]='a'
for i in range(y):
  ans[x*3+i*4][x*3+i*3+i*4]='a'
  ans[x*3+i*4][x*3+i*3+i*4+1]='b'
  ans[x*3+i*4][x*3+i*3+i*4+2]='c'
  ans[x*3+i*4][x*3+i*3+i*4+3]='c'
  
  ans[x*3+i*4+1][x*3+i*3+i*4]='a'
  ans[x*3+i*4+1][x*3+i*3+i*4+1]='b'
  ans[x*3+i*4+1][x*3+i*3+i*4+2]='d'
  ans[x*3+i*4+1][x*3+i*3+i*4+3]='d'
  
  ans[x*3+i*4+2][x*3+i*3+i*4]='e'
  ans[x*3+i*4+2][x*3+i*3+i*4+1]='e'
  ans[x*3+i*4+2][x*3+i*3+i*4+2]='g'
  ans[x*3+i*4+2][x*3+i*3+i*4+3]='h'
  
  ans[x*3+i*4+3][x*3+i*3+i*4]='f'
  ans[x*3+i*4+3][x*3+i*3+i*4+1]='f'
  ans[x*3+i*4+3][x*3+i*3+i*4+2]='g'
  ans[x*3+i*4+3][x*3+i*3+i*4+3]='h'

for i in range(n):
  print(''.join(ans[i]))

### FIXED CODE ###

import sys
n=int(input())
if n==2:
  print(-1)
  sys.exit()
if n==3:
  print('aa.')
  print('..a')
  print('..a')
  sys.exit()

x=(n//4)-1
y=(n%4)+4

l=[[['a','a','b','c'],['d','d','b','c'],['b','c','a','a'],['b','c','d','d']],[['a','a','b','b','a'],['b','c','c','.','a'],['b','.','.','c','b'],['a','.','.','c','b'],['a','b','b','a','a']],[['a','a','b','c','.','.'],['d','d','b','c','.','.'],['.','.','a','a','b','c'],['.','.','d','d','b','c'],['b','c','.','.','a','a'],['b','c','.','.','d','d']],[['a','a','b','b','c','c','.'],['d','d','.','d','d','.','a'],['.','.','d','.','.','d','a'],['.','.','d','.','.','d','b'],['d','d','.','d','d','.','b'],['.','.','d','.','.','d','c'],['.','.','d','.','.','d','c']]]

if n<8:
  for i in range(n):
    print(''.join(l[n-4][i]))
  sys.exit()

ans=[]
for i in range(n):
  ans1=['.']*n
  ans.append(ans1)

for i in range(x):
  for j in range(4):
    for k in range(4):
      ans[i*4+j][i*4+k]=l[0][j][k]

for j in range(y):
  for k in range(y):
    ans[x*4+j][x*4+k]=l[y-4][j][k]

for i in range(n):
  print(''.join(ans[i]))
# coding: utf-8
import os
import time
import re
import math


def main():
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[0]*(N+1)
    memo[0]=1
    ban=[False]*(N+1)
    for a in M:
        ban[a]=True
    mod=1000000007
    print(ban)
    for a in range(1,N+1):
        if ban[a]:
            memo[a]=0
        else:
            if a>1:
                memo[a]=(memo[a-1]+memo[a-2])%mod
            else:
                memo[a]=1



    print(memo[-1]%mod)
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#


main()


### FIXED CODE ###

# coding: utf-8
import os
import time
import re
import math


def main():
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[0]*(N+1)
    memo[0]=1
    ban=[False]*(N+1)
    for a in A:
        ban[a]=True
    mod=1000000007
    for a in range(1,N+1):
        if ban[a]:
            memo[a]=0
        else:
            if a>1:
                memo[a]=(memo[a-1]+memo[a-2])%mod
            else:
                memo[a]=1



    print(memo[-1]%mod)
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#


main()
from _collections import deque
X='abcdefghijklmnopqrstuvwxyz'*2
S=input()
k=int(input())
N=deque([])
for s in S:
    if s=='a':
        N.append(0)
    else:
        N.append(26-X.index(s))
important=0
for i in range(len(S)):
    if N[i]<=k :
        k-=N[i]
    else:
        important=i
        break
ans2=''
for i in range(important,len(S)-1):
    if N[i]<=k:
        ans2+='a'
        k-=N[i]
    else:
        ans2+=X[X.index(S[i])]

print('a'*important+ans2+X[X.index(S[-1])+k])

### FIXED CODE ###

X='abcdefghijklmnopqrstuvwxyz'*2
S=input()
k=int(input())
N=[]
for s in S:
    if s=='a':
        N.append(0)
    else:
        N.append(26-X.index(s))
ans=''
for i in range(len(S)):
    if N[i]<=k :
        k-=N[i]
        ans+='a'
    else:
        ans+=S[i]
ans=ans[:-1]+X[X.index(ans[-1])+k%26]

print(ans)
a, b, k = map(int, input().split())
for i in range(k):
  if a > 0:
    a = a - 1
  elif b > 0:
    b = b - 1
  else:
    none
print(a, b)

### FIXED CODE ###

a, b, k = map(int, input().split())
if a >= k:
  print(a-k, b)
elif k-a <= b:
  print(0, b-k+a)
else:
  print(0, 0)
H, W = map(int, input().split())
C = [input() for _ in range(H)]
for i in raneg(2*H):
  print(C[i//2 +1])


### FIXED CODE ###

H, W = map(int, input().split())
C = [input() for _ in range(H)]
for i in range(2*H):
  print(C[i//2])
a,b=map(int,input())

s = a*b - a - b
print(s)


### FIXED CODE ###


a,b=map(int,input().split())

s = a * b - a - b + 1
print(s)
https://atcoder.jp/contests/abc106/scoreN = int(input())
#cnt = 0
ans = 0
for i in range(1, N+1, 2):
    cnt = 0 
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)


### FIXED CODE ###

S = int(input())
ans = 0
count = 0
for i in range(1, S+1, 2):
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1
    count = 0
print(ans)
N = int(input())
bonus = N // 15 * 200
print(N * 800 - bonus)

### FIXED CODE ###

A, B = map(int,input().split())
if A == B:
  print("Draw")
elif A > B or A == 1:
  if B == 1:
    print("Bob")
  else:
    print("Alice")
else:
  print("Bob")
N = int(input())
H = [int(input()) for i in range(N)
count = 1
Max = H[0]
for i in range(1:N):
     if Max < H[i]:
         Max = H[i]
         count += 1

print(count)
     

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i+1]:
         x = H[i+1]
         count += 1

print(count)
s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    print(s[i:len(t)+i])
    if len(s[i:len(t)+i]) >= len(t):
        for l, j in zip(s[i:len(t)+i], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
     else:
      	break
print(len(t)-maxi)


### FIXED CODE ###

s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    if len(s[i:len(t)+i]) >= len(t):
        for l, j in zip(s[i:len(t)+i], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
print(len(t)-maxi)
a = map(int,raw_input().split())
print a**3

### FIXED CODE ###

a = input()
print a**3
from functools import reduce
n = (int)(input())
a = (list)(map(int, input().split()))
from functools import reduce
n = (int)(input())
a = (list)(map(int, input().split()))


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


def calcMod(a, m):
  return sum([m % v for v in a])


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


def lcm_list(l):
  g = reduce(lcm, l)
  return g


print(calcMod(a, (int)(lcm_list(a)-1)))


### FIXED CODE ###

from functools import reduce
n = (int)(input())
a = (list)(map(int, input().split()))


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


def calcMod(a, m):
  return sum([m % v for v in a])


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


def lcm_list(l):
  g = reduce(lcm, l)
  return g


def mul(a, b):
  return a*b


#print(calcMod(a, (int)(lcm_list(a)-1)))
print(calcMod(a, reduce(mul, a)-1))
#include<bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int>h(N);
  vector<int>dp(N);
  for (int i = 0; i < N; i++) {
    cin >> h.at(i);
    dp.at(i) = 0;
  }
  dp.at(1) = abs(h.at(1) - h.at(0));
  for (int i = 2; i < N; i++) {
    dp.at(i) = min(dp.at(i-1) + abs(h.at(i-1) - h.at(i)), dp.at(i-2) + abs(h.at(i-2) - h.at(i)));
  }
  cout << dp.at(N-1);
}

### FIXED CODE ###

N = int(input())
h = list(input().split())
for i in range(len(h)):
  h[i] = int(h[i])
dp = [0 for i in range(N)]
dp[1] = abs(h[0] - h[1])
for i in range(2,N):
  dp[i] = min(dp[i-1] + abs(h[i-1] - h[i]), dp[i-2] + abs(h[i-2] - h[i]))
print(dp[N-1])
n=a[0]
k=a[1]
if n%k==0:
    print('0')
else:
    print('1')

### FIXED CODE ###

a=list(map(int, input().split()))
n=a[0]
k=a[1]
if n%k==0:
    print('0')
else:
    print('1')
x = input()
a = x/3600
b = x%3600/60
c = x%3600%60/60
print a:b:c

### FIXED CODE ###

x = input()
a = x/3600
b = x%3600/60
c = x - a*3600 - b*60
print '%d:%d:%d'%(a, b, c)
a,b = map(int,input().split())
for i in range(1, 1001):
  if floor(i * 0.08) == a and floor(i * 0.1) == b:
    print(i)
else:
  print('-1')


### FIXED CODE ###

s = input()
for i in range(0,2):
  if s[i] != s[i+1]:
    print('Yes')
    break
else:
  print('No')
X=input()
m=int(X[0])
t=int(X[1:3])
print(1 if m*5>=t or len(X)>=4 else 0)

### FIXED CODE ###

X=input()
Xi=int(X)
if Xi>=100:
    if len(X)>=4 and Xi>=2000:
        print(1)
    else:
        if Xi<1000:
            print(1 if int(X[0])*5>=int(X[1:3]) else 0)
        else:
            print(1 if int(X[0:2])*5>=int(X[2:4]) else 0)
else:
    print(0)
n=int(input())
a=[list(map(int,input().split()))[::-1] for _ in range(n)]
tcnt,ans=0,0
while tcnt<n*(n-1)//2:
  cnt=0
  chk=[]
  for i in range(n-1):
    if i in chk:
      continue
    else:
      if a[i]:
        b=a[i][-1]-1
        if b in chk:
          continue
        else:
          if b>i and a[b][-1]-1==i:
            chk.append(a[i].pop()-1,a[b].pop()-1)
            cnt+=1
  tcnt+=cnt
  ans+=1
  if cnt==0:
    ans=-1
    break
print(ans)

### FIXED CODE ###

from collections import deque
n=int(input())
x=lambda i:int(i)-1
a=[deque(list(map(x,input().split()))+[-1]) for _ in range(n)] 
tcnt,ans=n*(n-1),0
chk=set(range(n))
while tcnt>0:
    chk_next=set()
    for i in chk:
        if a[a[i][0]][0]==i:
            chk_next.add(i)
    if len(chk_next)==0:
        ans=-1
        break
    tcnt-=len(chk_next)
    chk=set()
    for i in chk_next:
        a[i].popleft()
        chk.add(i)
        if a[i][0]!=-1:
            chk.add(a[i][0])
    ans+=1

print(ans)
N, X = map(int, input().split())
M = list(map(int, input().split()))
ans = 0
for m in range(M):
    X -= m
    ans += 1
ans += X // min(M)
print(ans)

### FIXED CODE ###

N, X = map(int, input().split())
M = [int(input()) for _ in range(N)]
ans = 0
for m in M:
    X -= m
    ans += 1
ans += X // min(M)
print(ans)
def dfs(g: {}, v: int, seen: [], current_color: int):
    seen[v] = current_color
    for (next_v, next_w) in g[v]:
        # next_v が探索済だったらスルー
        if seen[next_v] != -1:
            if current_color == seen[next_v] and next_w % 2 == 1:
                return False
            elif current_color != seen[next_v] and next_w % 2 == 0:
                return False
            continue
        next_color = current_color if next_w % 2 == 0 else 1 - current_color
        # 再帰的に探索
        return dfs(g, next_v, seen, next_color)
    return True


def main():
    n = int(input())

    g = {}
    for i in range(n-1):
        u, v, w = map(int, input().split())
        dic_a = g.setdefault(u-1, [])
        dic_a.append((v-1, w))
        dic_b = g.setdefault(v-1, [])
        dic_b.append((u-1, w))
    # -1:not clear, 0:white, 1:black
    seen = [-1] * n

    is_bipartite = True
    for i in range(n):
        if seen[i] != -1:
            continue
        if not dfs(g, i, seen, 0):
            is_bipartite = False
            break

    if is_bipartite:
        for i in range(n):
            print(seen[i])
    else:
        print("is not bipartite")

main()


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)


def dfs(g: {}, v: int, seen: [], current_color: int):
    seen[v] = current_color
    for (next_v, next_w) in g[v]:
        # next_v が探索済だったらスルー
        if seen[next_v] != -1:
            if current_color == seen[next_v] and next_w % 2 == 1:
                return False
            elif current_color != seen[next_v] and next_w % 2 == 0:
                return False
            continue
        next_color = current_color if next_w % 2 == 0 else 1 - current_color
        # 再帰的に探索
        if not dfs(g, next_v, seen, next_color):
            return False
    return True


def main():
    n = int(input())

    g = {}
    for i in range(n-1):
        u, v, w = map(int, input().split())
        dic_a = g.setdefault(u-1, [])
        dic_a.append((v-1, w))
        dic_b = g.setdefault(v-1, [])
        dic_b.append((u-1, w))
    # -1:not clear, 0:white, 1:black
    seen = [-1] * n

    is_bipartite = True

    for i in range(n):
        if seen[i] != -1:
            continue
        if not dfs(g, i, seen, 0):
            is_bipartite = False
            break

    if is_bipartite:
        for i in range(n):
            print(seen[i])
    else:
        print("is not bipartite")

main()
def main():
    x, n = map(int, input().split(" "))
    p =[]
    dif = 1e2
    ans = 0
    l_a = [i for i in range(101)]
    if n != 0:
        p = list(map(int, input().split(" ")))
    for ele in l_a[::-1]:
        if abs(x - ele) <= dif and ele not in p:
            ans = ele
            dif = abs(x - ele)
    print(ans)
if __name__ == "__main__":
    main()

### FIXED CODE ###


def main():
    x = list(map(int, input().split(" ")))
    for i in range(5):
        if x[i] == 0:
            print(i +1)

if __name__ == "__main__":
    main()
from collections import Counter
N=int(input())
xy=[list(map(int,input().split())) for _ in range(N)]

pq=[]
for i in range(N):
  for j in range(i+1,N):
    pq.append([xy[j][0]-xy[i][0],xy[j][1]-xy[i][1]])

print(N-Counter(map(lambda x:x[0]*10**10+x[1],pq)).most_common()[0][1])

### FIXED CODE ###

from collections import Counter
N=int(input())
xy=[list(map(int,input().split())) for _ in range(N)]
xy.sort()

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

pq=[]
for i in range(N):
  for j in range(i+1,N):
    pq.append([xy[j][0]-xy[i][0],xy[j][1]-xy[i][1]])

print(N-Counter(map(lambda x:x[0]*10**10+x[1],pq)).most_common()[0][1])
s = int(input())
if s == 1 or s == 2:
    print(4)
    res = 1
else:
    while True:
        if s == 4:
            break
        else:
            if s % 2 == 0:
                s = s // 2
            else:
                s = 3 * s + 1
            res += 1

    print(res+3)

### FIXED CODE ###

s = int(input())
if s == 1 or s == 2:
    print(4)
else:
    res = 1
    while True:
        if s == 4:
            break
        else:
            if s % 2 == 0:
                s = s // 2
            else:
                s = 3 * s + 1
            res += 1

    print(res+3)
import bisect as bi
a,b,q = map(int,input().split())
s = sorted([int(input()) for i in range(a) ])
t = sorted([int(input()) for i in range(b) ])
x = sorted([int(input()) for i in range(q) ])

for i in range(q):
    Q = x[i]
    ans_s = []
    ans_t = []
    ans_s.append(s[bi.bisect_left(s,Q)])
    ans_t.append(t[bi.bisect_left(t,Q)])
    ans = 10**11
    
    if bi.bisect_right(s,Q) == len(s):
        ans_s.append(s[bi.bisect_left(s,Q)-1])
    else:
        ans_s.append(s[bi.bisect_left(s,Q)])
        
    if bi.bisect_right(t,Q) == len(t):
        ans_t.append(t[bi.bisect_left(t,Q)-1])
    else:
        ans_t.append(t[bi.bisect_left(t,Q)])
    
    for i in range(2):
        for j in range(2):
            ans = max(ans,abs(ans_s[i]-Q)+abs(ans_s[i]-ans_t[j]),abs(ans_t[j]-Q)+abs(ans_s[i]-ans_t[j]))
    
    print(ans)

### FIXED CODE ###

import bisect as bi
a,b,q = map(int,input().split())
s = sorted([int(input()) for i in range(a) ])
t = sorted([int(input()) for i in range(b) ])
x = [int(input()) for i in range(q) ]

for i in range(q):
    Q = x[i]
    ans_s = []
    ans_t = []
    ans_s.append(s[bi.bisect_left(s,Q)-1])
    ans_t.append(t[bi.bisect_left(t,Q)-1])
    ans = 10**11
    
    if bi.bisect_right(s,Q) == len(s):
        ans_s.append(s[bi.bisect_left(s,Q)-1])
    else:
        ans_s.append(s[bi.bisect_left(s,Q)])
        
    if bi.bisect_right(t,Q) == len(t):
        ans_t.append(t[bi.bisect_left(t,Q)-1])
    else:
        ans_t.append(t[bi.bisect_left(t,Q)])
    
    for i in range(2):
        for j in range(2):
            ans = min(ans,abs(ans_s[i]-Q)+abs(ans_s[i]-ans_t[j]),abs(ans_t[j]-Q)+abs(ans_s[i]-ans_t[j]))
    
    print(ans)
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

n,m = map(int,input().split())
x = sorted(list(map(int,input().split())))
diff = []
if m == 1:
    print(0)
    sys.exit()
for i in range(m-1):
    d = x[i+1] - x[i]
    diff.append(d)
diff.sort(reverse= True)
for i in range(n-1):
    diff[i] = 0
print(sum(diff))

### FIXED CODE ###

import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

n,m = map(int,input().split())
x = sorted(list(map(int,input().split())))
diff = []
visit = [False]*m
visit[0] = True
if m == 1 or n>=m:
    print(0)
    sys.exit()
for i in range(m-1):
    d = x[i+1] - x[i]
    diff.append(d)
diff.sort(reverse= True)
for i in range(n-1):
    diff[i] = 0
print(sum(diff))
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    import pdb;pdb.set_trace()
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])

### FIXED CODE ###

if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])
n, k = map(int, input().split())
s = input()

def count_diff(a,b):
    cnt = 0
    for c1,c2 in zip(a, b):
        if c1 != c2:
            cnt += 1
    return cnt

s2 = s[1:]
cnt = count_diff(s[:-1], s2)
init = n - cnt - 1

if s[0] == "L" and s[1] == "L":
    if s[-1] == "R" and s[-2] == "R":
        init -= 1

print(init + (2 * k))

### FIXED CODE ###

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

def count_diff(a,b):
    cnt = 0
    for c1,c2 in zip(a, b):
        if c1 != c2:
            cnt += 1
    return cnt

s2 = s[1:]
cnt = count_diff(s[:-1], s2)
init = n - cnt - 1

ans = min(n-1, init + (2 * k))

print(ans)