fun main(args: Array<String>) {
    val t = "qwertyuiopasdfghjkl;zxcvbnm,./"
    val s = readLine()
    val m = if (s=="R") -1
    else 1
    val z = readLine()!!.toString()
    for (c in z) print(t[t.indexOf(c)+m])
}

import java.io.*
import java.util.*

class ProblemIO(val rd: BufferedReader, val wr: PrintWriter) {
    companion object {
        fun console() = ProblemIO(BufferedReader(InputStreamReader(System.`in`)), PrintWriter(System.out))
    }

    var tok = StringTokenizer("")

    fun close() { rd.close(); wr.close() }
    fun <T> print(v: T) = wr.print(v)
    fun <T> println(v: T) = wr.println(v)
    fun readToken(): String {
        while (!tok.hasMoreTokens()) tok = StringTokenizer(rd.readLine())
        return tok.nextToken()
    }
    fun readInt() = readToken().toInt()
    fun readLong() = readToken().toLong()
    fun readLine() : String {
        tok = StringTokenizer("")
        return rd.readLine()
    }
}

fun main(args: Array<String>) {
    Thread({ val io = ProblemIO.console(); solve(io) ; io.close() }).start()
}

fun solve(io: ProblemIO) {
    val kbd = arrayOf("qwertyuiop", "asdfghjkl;", "zxcvbnm,./")
    val lm = HashMap<Char, Char>()
    val rm = HashMap<Char, Char>()
    for (s in kbd) {
        for (i in s.indices) {
            if (i > 0) lm[s[i]] = s[i - 1]
            if (i < s.lastIndex) rm[s[i]] = s[i + 1]
        }
    }
    val d = io.readToken()
    val m = if (d == "L") rm else lm
    val s = io.readToken()
    io.println(s.map({ ch -> m[ch] }).joinToString(""))
}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    //val len = r.readLine()!!.toInt()
    //val (n, m) = r.readLine()!!.split(" ").map { it.toInt() }
    val type = r.readLine()!!
    val str = "qwertyuiopasdfghjkl;zxcvbnm,./".split("").filter { it.length > 0 }
    val before = r.readLine()!!
    before.forEach {
        var i = str.indexOf(it.toString())
        if (type=="R") i--
        else i++
        s.append(str[i])
    }
    println(s)
}

import java.lang.StringBuilder

private const val layout = "qwertyuiopasdfghjkl;zxcvbnm,./"

fun main(args: Array<String>) {
    val direction = readLine()!!
    val message = readLine()!!
    val correction = if (direction == "L") 1 else -1
    val result = StringBuilder()
    for (char in message) {
        val currentIndex = layout.indexOf(char)
        val requiredCharIndex = currentIndex + correction
        val requiredChar = layout[requiredCharIndex]
        result.append(requiredChar)
    }
    print(result)
}

fun main() = Pair(readLine()!! == "R", readLine()!!)
    .let { (rightShifted, wrongMessage) ->
        val shiftedKeysMap = hashMapOf<Char, Pair<Char, Char>>().apply {
            "qwertyuiopasdfghjkl;zxcvbnm,./".let { keyboard ->
                keyboard.forEachIndexed { index, key ->
                    put(
                        key,
                        Pair(keyboard.getOrNull(index - 1) ?: '*', keyboard.getOrNull(index + 1) ?: '*')
                    )
                }
            }
        }
        wrongMessage
            .map { key -> shiftedKeysMap[key]!!.run { if (rightShifted) first else second } }
            .joinToString("")
    }
    .run(::println)

fun main() {
    val shift = readLine()!!
    val output = readLine()!!.map { getLetter(shift, it) }.joinToString("")
    println(output)
}

fun getLetter(shift: String, char: Char): Char {
    val line = listOf(
        "qwertyuiop",
        "asdfghjkl;",
        "zxcvbnm,./"
    ).first { it.contains(char) }

    val position = line.indexOf(char)
    val shiftIndex = if (shift == "L") 1 else -1
    return line.get(position + shiftIndex)
}

fun main()
{
    val abc="qwertyuiopasdfghjkl;zxcvbnm,./"
    var dir = readLine().toString()
    var text = readLine().toString()
    val t = text.toCharArray()
    for(index in 0..text.length-1)
    {
        if (dir == "R") {
            val eindex: Int = abc.indexOf(t[index]) - 1
            t[index] = abc[eindex]

        } else {
            val eindex: Int = abc.indexOf(t[index]) + 1
            t[index] = abc[eindex]
        }

    }
      text = String(t)
    println(text)
}

import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.StringBuilder

fun main() {
    val br = BufferedReader(InputStreamReader(System.`in`))
    val shifting = br.readLine()
    val s = br.readLine()
    val keys = ("qwertyuiop" + "asdfghjkl;" + "zxcvbnm,./").toList()
    val keysIndices = keys.zip(keys.indices).toMap()
    println(
        s.fold(StringBuilder()){acc, c ->
            acc.apply {
                append(
                    if (shifting == "R") keys[keysIndices[c]!! - 1]
                    else keys[keysIndices[c]!! + 1]
                )
            }
        }
    )
}

import java.math.BigInteger

fun main() {
    var direction = readLine()!!
    var str = readLine()!!
    var ansStr = "qwertyuiopasdfghjkl;zxcvbnm,./"
    var ans =""
    if (direction=="R"){
        for (i in str){
            var j = 1
            while (j<ansStr.length){
                if (i==ansStr[j]){
                    ans+=ansStr[j-1]
                    break
                }
                j++

            }
        }
    }else{
        for (i in str){
            var j = 0
            while (j<ansStr.length){
                if (i==ansStr[j]){
                    ans+=ansStr[j+1]
                    break
                }
                j++

            }
        }
    }
    println(ans)
}

fun main(args: Array<String>) {
    val keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./"
    val dir = if (readLine()!! == "R") -1 else 1
    val input = readLine()!!
    println(String(input.map { it -> keyboard[keyboard.indexOf(it) + dir] }.toCharArray()))
}

fun main(args:Array<String>) {
    val a="qwertyuiopasdfghjkl;zxcvbnm,./"
    val LR= readLine()!!
    var x= readLine()!!
    var result=""
    var f=1
    if(LR=="R")
        f*=-1
    for(i in 0 until x.length){
      result+=a[a.indexOf(x[i])+f]
    }
    println(result)
}

import java.lang.AssertionError
import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

private fun myAssert(x: Boolean) {
    if (!x) {
        throw AssertionError()
    }
}

fun main(args: Array<String>) {
//  var s = Scanner(System.`in`)
  var cmd = readLn()
  var line = readLn()
  var map = mutableMapOf<Char, Char>()
  var keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./"
  if (cmd == "R") {
    for (i in 1..keyboard.length - 1) {
      map[keyboard[i]] = keyboard[i - 1]
    }
    for (i in 0..line.length - 1) {
      print("${map[line[i]]}")
    }
    print("\n")
  } else {
    for (i in 0..keyboard.length - 2) {
      map[keyboard[i]] = keyboard[i + 1]
    }
    for (i in 0..line.length - 1) {
      print("${map[line[i]]}")
    }
    print("\n")
  }
}

fun main() {
    val shift = if (readLine()!! == "R") -1 else 1
    val text = readLine()!!
    val map = mutableMapOf<Char, Pair<Int, Int>>()
    val lines = arrayOf("qwertyuiop", "asdfghjkl;", "zxcvbnm,./")
    for (linePos in 0 until 3)
        for ((charPos, char) in lines[linePos].withIndex())
            map[char] = linePos to charPos
    val sb = StringBuilder()
    for (c in text) {
        val (linePos, charPos) = map[c]!!
        sb.append(lines[linePos][charPos + shift])
    }
    print(sb.toString())
}

import java.util.TreeMap

interface LexicographicComparable<T> : Comparable<T> {
  fun num_fields() : Int
  fun compare_field(i : Int, other : T) : Int

  override fun compareTo(other : T) : Int {
    val n = num_fields()
    for (i in 0 .. (n - 1)) {
      val c = compare_field(i, other)
      if (c == 0) {
        // Do nothing ...
      } else {
        return c
      }
    }
    return 0
  }
}

class KeyboardCharacter : LexicographicComparable<KeyboardCharacter> {
  val row : Int
  val index : Int

  constructor(row : Int, index : Int) {
    this.row = row
    this.index = index
  }

  fun neighbor(l_or_r : String) : KeyboardCharacter {
    when (l_or_r) {
      "L" -> return KeyboardCharacter(this.row, this.index + 1)
      "R" -> return KeyboardCharacter(this.row, this.index - 1)
      else -> throw Exception("Unknown neighbor.")
    }
  }

  override fun num_fields() : Int {
    return 2
  }

  override fun compare_field(i : Int, other : KeyboardCharacter) : Int {
    when (i) {
      0 -> return this.row.compareTo(other.row)
      1 -> return this.index.compareTo(other.index)
      else -> throw Exception("Invalid field!")
    }
  }

  override fun toString() : String {
    return "(${this.row}, ${this.index})"
  }
}

fun updateKeyboard(row : Int,
                   keys : String,
                   kbToChar : TreeMap<KeyboardCharacter, Char>,
                   charToKb : TreeMap<Char, KeyboardCharacter>) {
  var index = 0
  for (char in keys) {
    val kb = KeyboardCharacter(row, index)
    kbToChar.put(kb, char)
    charToKb.put(char, kb)
    index = index + 1
  }
}

fun readString() : String {
  val str_nullable = readLine()
  if (str_nullable == null) {
    throw Exception("Could not read string!")
  } else {
    val str = str_nullable
    return str
  }
}

fun main(args : Array<String>) {
  val row_0 = "qwertyuiop"
  val row_1 = "asdfghjkl;"
  val row_2 = "zxcvbnm,./"
  val kbToChar = TreeMap<KeyboardCharacter, Char>()
  val charToKb = TreeMap<Char, KeyboardCharacter>()
  updateKeyboard(0, row_0, kbToChar, charToKb)
  updateKeyboard(1, row_1, kbToChar, charToKb)
  updateKeyboard(2, row_2, kbToChar, charToKb)
  // println("${kbToChar}")
  // println("${charToKb}")
  val l_or_r = readString()
  val str = readString()
  fun translate(c : Char) : Char {
    val kb_nullable = charToKb[c]
    if (kb_nullable == null) {
      throw Exception("1. Could not translate character!")
    } else {
      val kb = kb_nullable
      val kb_nbr = kb.neighbor(l_or_r)
      val nbr_c_nullable = kbToChar[kb_nbr]
      if (nbr_c_nullable == null) {
        throw Exception("2. Could not translate character!")
      } else {
        val nbr_c = nbr_c_nullable
        return nbr_c
      }
    }
  }
  str.forEach({c -> val t = translate(c)
                    print(t) })
  println()
}

import java.util.*

/**
 * Created by tux on 08.11.16.
 */

fun main(args: Array<String>) {
    val K = listOf("qwertyuiop", "asdfghjkl;", "zxcvbnm,./")
    val M = HashMap<Char, Pair<Int, Int>>()
    for (j in 0..(K.size - 1)) {
        for (i in 0..(K[j].length - 1)) {
            M.put(K[j][i], Pair(j, i))
        }
    }

    val offset = if (readLine()!![0] == 'R') -1 else +1
    var ret = ""
    readLine()!!.forEach {
        val p = M[it]!!
        ret += K[p.first][p.second + offset]
    }
    println(ret)
}

fun main(args: Array<String>) {

    val first = "qwertyuiopasdfghjkl;zxcvbnm,./"

    val command = readLine()!!

    val message = readLine()!!

    var result= ""

    message.forEach { c ->
        val position = first.indexOf(c)
        result += if (command == "R"){
            first[position - 1]
        }else{
            first[position + 1]
        }

    }

    println(result)
}

import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.*
import kotlin.system.measureTimeMillis

fun getMinimumAmountOfChangeFrom(amount: Int): Int {
    val changes = listOf(10, 5, 1)
    var availableAmount = amount
    var numOfCoins = 0
    for (change in changes) {
        while (availableAmount > 0 && availableAmount / change.toDouble() >= 1) {
            numOfCoins += 1
            availableAmount -= change
        }
    }
    return numOfCoins
}

fun getMaximumValueOfTheLootWith(
    W: Int,
    valuePerUnitAndWeight: List<Pair<Double, Int>>
): Double {
    var maximumLootValue = 0.0
    var availableWeight = W
    for (pair in valuePerUnitAndWeight) {
        var availableWeightOfLootItem = pair.second
        while (availableWeight > 0 && availableWeightOfLootItem > 0) {
            maximumLootValue += pair.first
            availableWeightOfLootItem -= 1
            availableWeight -= 1
        }
    }
    return maximumLootValue
}

fun getMinimumNumOfRefills(d: Int, m: Int, stops: List<Int>): Int {
    var availableDistance = d
    var minimumRefills = 0
    var currentRefill = 0
    var lastRefill = 0
    val realStops = listOf<Int>(0, *stops.toTypedArray(), d)
    while (availableDistance > 0 && currentRefill < realStops.size) {
        var movedForward = false
        while (currentRefill < realStops.size && (realStops[currentRefill] - realStops[lastRefill]) <= m) {
            if (realStops[currentRefill] - realStops[lastRefill] == 0) {
                movedForward = false
                currentRefill++
            } else {
                movedForward = true
                currentRefill++
            }
        }
        if (movedForward) {
            minimumRefills++
            currentRefill--
            availableDistance -= (realStops[currentRefill] - realStops[lastRefill])
            lastRefill = currentRefill
        } else {
            return -1
        }
    }
    return minimumRefills - 1
}

fun getMaximizedSumOfProduct(profitPerClick: List<Int>, averageNumberOfClicks: List<Int>): Long {
    var sum = 0L
    println(profitPerClick.toString())
    println(averageNumberOfClicks.toString())
    profitPerClick.forEachIndexed { index, profit ->
        sum += profit * averageNumberOfClicks[index]
    }
    return sum
}

fun getCommon(first: Int, last: Int, segments: MutableList<Pair<Int, Int>>): String {
    var current = first
    val common = mutableListOf<Pair<Int, Int>>()
    while (current <= last) {
        var numOfTimes = 0
        for (pair in segments) {
            if (current in pair.first..pair.second) {
                numOfTimes++
            }
        }
        if (numOfTimes > 1) {
            common.add(Pair(current, numOfTimes))
        }
        current++
    }
    common.sortByDescending { it -> it.second }
    if (common.first().second == segments.size) {
        return "1\n${common.first().first}"
    }
    println(common)
    return "${common.size}\n${common.map { it.first }.joinToString(" ")}"
}

fun getMaximumSetOfPrizes(n: Int): String {
    var numbersOfN = ""
    var sumSoFar = 0
    if (n <= 2) {
        return "1\n$n"
    }
//    println("2*square root of n = ${2 * sqrt(n.toDouble())}")
//    for (i in 1..(2 * sqrt(n.toDouble()).toInt())){
//        if (i+sumSoFar<=n){
//            numbersOfN+="$i "
//            sumSoFar+=i
//        }
//    }
//    var lastNumber = 1
    var currentNumber = 1
    while (((currentNumber + 1) + currentNumber) <= n - sumSoFar) {
        sumSoFar += currentNumber
        numbersOfN += "$currentNumber "
        currentNumber++
    }
    if (((n - currentNumber) + sumSoFar) == n || n - sumSoFar > 0) {
        currentNumber = n - sumSoFar
        sumSoFar += currentNumber
        numbersOfN += "$currentNumber "
    }
//    else if (n-sumSoFar>0){
//        currentNumber = n-sumSoFar
//        numbersOfN += "$currentNumber "
//    }
    return "${numbersOfN.trim().split(" ").size}\n$numbersOfN"
}

fun linelandMail(coordinates: List<Long>): String {
    val mins = mutableListOf<Long>()
    val maxs = mutableListOf<Long>()
    for (i in coordinates.indices) {
        if (i == 0) {
            mins.add(abs(coordinates[i] - coordinates[i + 1]))
            maxs.add(abs(coordinates[i] - coordinates[coordinates.size - 1]))
        } else if (i == coordinates.size - 1) {
            mins.add(abs(coordinates[i] - coordinates[i - 1]))
            maxs.add(abs(coordinates[i] - coordinates[0]))
        } else {
            if (abs(coordinates[i] - coordinates[i - 1])
                > abs(coordinates[i] - coordinates[i + 1])
            )
                mins.add(abs(coordinates[i] - coordinates[i + 1]))
            else
                mins.add(abs(coordinates[i] - coordinates[i - 1]))

            if (abs(coordinates[i] - coordinates[0])
                < abs(coordinates[i] - coordinates[coordinates.size - 1])
            )
                maxs.add(abs(coordinates[i] - coordinates[coordinates.size - 1]))
            else
                maxs.add(abs(coordinates[i] - coordinates[0]))
        }
    }
    return mins
        .zip(maxs)
        .map { pair -> "${pair.first} ${pair.second}" }
        .joinToString("\n")
}

fun snacktower(snacksWeights: List<Int>) {
    val n = snacksWeights.size
    var currentMax = n
    var current = 0
    var processed = mutableListOf<Int>()
    while (current < snacksWeights.size) {
        if (snacksWeights[current] < currentMax) {
            processed.add(snacksWeights[current])
            print("\n")
            current++
        } else {
            if (snacksWeights[current] == currentMax) {
                print(currentMax)
                currentMax--
                var currentProcessed = 0
                while (currentProcessed < processed.size) {
                    var foundConsecutive = false
                    if (processed[currentProcessed] == currentMax) {
                        print(" ")
                        print(processed[currentProcessed])
                        currentMax--
                        foundConsecutive = true
                        processed = processed.swap(currentProcessed, processed.size - 1).toMutableList()
                        processed.removeAt(processed.size - 1)
                    }
                    if (!foundConsecutive) {
                        currentProcessed++
                    } else {
                        currentProcessed = 0
                    }
                }
                println()
                current++
            }
        }
    }
}

fun <T> List<T>.swap(a: Int, b: Int): List<T> = this
    .toMutableList()
    .also {
        it[a] = this[b]
        it[b] = this[a]
    }

fun `Oath of the Night's Watch`(stewardsStrengths: List<Int>) {
    val sortedStrengths = stewardsStrengths.sorted()
    var numberOfThoseWhoNeedSupport = 0
    for (strengthIndex in sortedStrengths.indices) {
        val precedingSteward = strengthIndex - 1
        val nextSteward = strengthIndex + 1
        if (precedingSteward>=0 && nextSteward<sortedStrengths.size){
            if (sortedStrengths[precedingSteward]<sortedStrengths[strengthIndex]
                && sortedStrengths[nextSteward]>sortedStrengths[strengthIndex]){
                numberOfThoseWhoNeedSupport++
            }
        }
    }
    println(numberOfThoseWhoNeedSupport)
}

fun pangram(characters: String){
    print(if (characters.toLowerCase().toSet().size==26) "YES" else "NO")
}

fun twins(coinsValues: List<Int>){
    val sortedValues = coinsValues.sortedDescending()
    var mySumSoFar = 0
    var numberOfCoinsIWillTake = 0
    for (index in sortedValues.indices){
        mySumSoFar+=sortedValues[index]
        numberOfCoinsIWillTake++
        if (mySumSoFar>sortedValues.subList(index+1,sortedValues.size).sum()){
            break
        }
    }
    println(numberOfCoinsIWillTake)
}

fun keyboard(handSlippedTo: Char, codedMessage: String){
    val hisKeyboard = "qwertyuiopasdfghjkl;zxcvbnm,./"
    for (char in codedMessage){
        when(handSlippedTo){
            'R'->{
                print(hisKeyboard[hisKeyboard.indexOf(char)-1])
            }
            'L'->{
                print(hisKeyboard[hisKeyboard.indexOf(char)+1])
            }
        }
    }
}
fun main() {

//    val scanner = Scanner(System.`in`)
//    val n = scanner.nextInt()
//    val snacksWeights = MutableList<Int>(n) { index -> 0 }
//    for (i in 0 until n) {
//        snacksWeights[i] = scanner.nextInt()
//    }
//    snacktower(snacksWeights)
//    val scanner = Scanner(System.`in`)
//    val n = scanner.nextInt()
//    val strengths = MutableList<Int>(n) { index -> 0 }
//    for (i in 0 until n) {
//        strengths[i] = scanner.nextInt()
//    }
//    `Oath of the Night's Watch`(strengths)
    val scanner = Scanner(System.`in`)
    val direction = scanner.next()
    val codedMessage = scanner.next()
    keyboard(direction[0],codedMessage)
}

// start of stress test
//    while (true) {
//        val n = Random.nextLong(1000000)
//        val m = Random.nextLong(100000)
//        if (m<n){
//            val res1 = getFibonacciPartialSumNaive(m,n)
//            val res2 = getLastDigitOfSumOfSubsetOfFibs(m,n)
//            if (res1.toInt() == res2) {
//                println("Ok")
//            } else {
//                println("Wrong Answer at n = $n and m = $m")
//                print("$res1 $res2")
//                break
//            }
//        }
//
//    }

fun main(args: Array<String>) {
    val strs = arrayOf<String>("qwertyuiop", "asdfghjkl;", "zxcvbnm,./")
    val R = mutableMapOf<Char, Char>()
    val L = mutableMapOf<Char, Char>()
    for (str in strs) {
        for (i in 1..str.length-1) {
            R.put(str[i-1], str[i])
            L.put(str[i], str[i-1])
        }
    }
    val dir = readLine()!![0]
    val s = readLine()!!
    for (c in s) {
        if (dir == 'R') {
            print(L[c])
        } else {
            print(R[c])
        }
    }
    print("\n")
}

import java.util.Scanner

fun main(args: Array<String>) {
    val input = Scanner(System.`in`)
    var Direction: String = input.next()
    var Word: String = input.next()
    var lettList = ArrayList<Char>()

    val keyboard = "qwertyuiop[]asdfghjkl;'zxcvbnm,./"

    for(letter in Word.indices) {
        for (checker in keyboard.indices) {
            if(Word.get(letter) == keyboard.get(checker)) {
                if(Direction.equals("R")) {
                    lettList.add(keyboard.get(checker-1))
                } else {
                    lettList.add(keyboard.get(checker+1))
                }
            }
        }
    }

    var Res: String = lettList.joinToString("")
    println(Res)
}

fun main(args:Array<String>) {
    val a="qwertyuiopsdfghjkl;zxcvbnm,./"
    val LR= readLine()!!
    var x= readLine()!!
    var result=""
    var f=1
    if(LR=="R")
        f*=-1
    for(i in 0 until x.length){
      result+=a[a.indexOf(x[i])+f]
    }
    println(result)
}

import java.lang.AssertionError
import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

private fun myAssert(x: Boolean) {
    if (!x) {
        throw AssertionError()
    }
}

fun main(args: Array<String>) {
//  var s = Scanner(System.`in`)
  var cmd = readLn()
  var line = readLn()
  var map = mutableMapOf<Char, Char>()
  var keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./"
  if (cmd == "R") {
    for (i in 1..keyboard.length - 1) {
      map[keyboard[i]] = keyboard[i - 1]
    }
    for (i in 0..line.length - 1) {
      print("${map[line[i]]}")
    }
    print("\n")
  } else {
    for (i in 0..keyboard.length - 2) {
      map[keyboard[i]] = keyboard[i + 1]
    }
    for (i in 0..line.length - 1) {
      print("${map[line[i]]}\n")
    }
    print("\n")
  }
}


import java.io.*
import java.util.*
import kotlin.math.min

fun main(args: Array<String>) {
    solve(System.`in`, System.out)
}

val MAX_N = (1e6 + 10).toInt()
val INF = (1e9 + 7).toInt()
val MOD = (1e9 + 7).toInt()

fun solve(input: InputStream, output: OutputStream) {
    val reader = InputReader(BufferedInputStream(input))
    val writer = PrintWriter(BufferedOutputStream(output))

    solve(reader, writer)
    writer.close()
}

fun solve(reader: InputReader, writer: PrintWriter) {
    val n = reader.nextInt()
    val s = reader.next()

    var ans = n

    for (l in (0 until n / 2).reversed()) {
        val pref = s.slice(0..l)
        val r = 2 * l + 1
        val nexts = s.slice(l + 1..r)

        if (pref == nexts) {
            val t = pref.length + 1 + (n - 2 * pref.length)
            ans = min(ans, t)
        }
    }
    writer.println(ans)
}

class InputReader(stream: InputStream) {
    val reader: BufferedReader
    var tokenizer: StringTokenizer? = null

    init {
        reader = BufferedReader(InputStreamReader(stream), 32768)
        tokenizer = null
    }

    operator fun next(): String {
        while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextArrayInt(count: Int): IntArray {
        return nextArrayInt(0, count)
    }

    fun nextArrayInt(start: Int, count: Int): IntArray {
        val a = IntArray(start + count)
        for (i in start until start + count) {
            a[i] = nextInt()
        }
        return a
    }

    fun nextArrayLong(count: Int): LongArray {
        val a = LongArray(count)
        for (i in 0 until count) {
            a[i] = nextLong()
        }
        return a
    }
}

import java.util.*
import kotlin.math.*

fun check(s: String, start: Int): Boolean {
    for (i in 0 until start) {
        if (start + i >= s.length || s[i] != s[start + i])
            return false
    }
    return true
}

fun main(args: Array<String>) {
    Scanner(System.`in`.buffered()).use {
        val n = it.nextInt()
        val s = it.next()

        var ans = n
        for (i in 1 .. n / 2) {
            if (check(s, i))
                ans = min(ans, i + 1 + n - 2 * i)
        }

        println(ans)
    }
}


import kotlin.math.abs

fun main() {
    var (n, pos, l, r) = readLine()!!.split(" ").map(String::toInt)
    val toDelete = mutableListOf<Pair<Int, Int>>()
    if (l > 1)
        toDelete.add(pos - l to l)
    if (r < n)
        toDelete.add(r - pos to r)
    toDelete.sortBy { it.first }
    var sol = 0
    for(tab in toDelete) {
        sol += abs(pos -tab.second) + 1
        pos = tab.second
    }
    print(sol)
}

import java.util.*

fun abs(x: Int) = if (x >= 0) x else -x

fun main(args: Array<String>) = with(Scanner(System.`in`)) {
    val n = nextInt(); val pos = nextInt()
    val l = nextInt(); val r = nextInt()

    val leftToRight = abs(pos - l) + 1 + (1 + r - l) * (if (r != n) 1 else 0)
    val rightToLeft = abs(r - pos) + 1 + (1 + r - l) * (if (l != 1) 1 else 0)

    if (l == 1 && r == n) {
        print(0)
    } else {
        print(minOf(leftToRight, rightToLeft))
    }
}

import java.io.*
import java.util.*
import kotlin.math.abs
import kotlin.math.min

class B {
    fun solve(input : InputStream, output : OutputStream) {
        val reader = InputReader(BufferedInputStream(input))
        val writer = PrintWriter(BufferedOutputStream(output))

        val n = reader.nextInt()
        val pos = reader.nextInt()
        val l = reader.nextInt()
        val r = reader.nextInt()

        writer.println(solve(n, pos, l, r))

        writer.close()
    }

    fun range(a : Int, b : Int) : Int {
        return abs(a - b)
    }

    fun solve(n : Int, pos : Int, l : Int, r : Int) : Int {
        if (l == 1 && r == n) {
            return 0
        }
        if (l == 1) {
            return range(pos, r) + 1
        }
        if (r == n) {
            return range(pos, l) + 1
        }

        val leftFirst = range(pos, l) + 1 + range(l, r) + 1
        val rightFirst = range(pos, r) + 1 + range(l, r) + 1
        return min(leftFirst, rightFirst)
    }

    private class InputReader(stream: InputStream) {
        var reader: BufferedReader
        var tokenizer: StringTokenizer? = null

        init {
            reader = BufferedReader(InputStreamReader(stream), 32768)
            tokenizer = null
        }

        operator fun next(): String {
            while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
                try {
                    tokenizer = StringTokenizer(reader.readLine())
                } catch (e: IOException) {
                    throw RuntimeException(e)
                }

            }
            return tokenizer!!.nextToken()
        }

        fun nextInt(): Int {
            return Integer.parseInt(next())
        }

        fun nextLong(): Long {
            return java.lang.Long.parseLong(next())
        }
    }
}

fun main(args : Array<String>) {
    B().solve(System.`in`, System.out)
}

fun main() {
    val (n, pos, l, r) = readLine()!!.split(" ").map(String::toInt)
    val toDelete = mutableListOf<Int>()
    if (l > 1)
        toDelete.add(pos - l)
    if (r < n)
        toDelete.add(r - pos)
    toDelete.sort()
    var sol = 0
    when (toDelete.size) {
        1 -> sol += toDelete[0] + 1
        2 -> sol += toDelete[0] + 1 + toDelete[0] + toDelete[1] + 1
    }
    print(sol)
}

import java.util.*

fun main(args: Array<String>) = with(Scanner(System.`in`)) {
    val n = nextInt(); val pos = nextInt()
    val l = nextInt(); val r = nextInt()

    val leftToRight = pos - l + 1 + (1 + r - l) * (if (r != n) 1 else 0)
    val rightToLeft = r - pos + 1 + (1 + r - l) * (if (l != 1) 1 else 0)

    if (l == 1 && r == n) {
        print(0)
    } else {
        print(minOf(leftToRight, rightToLeft))
    }
}


fun main() {
    val n = Integer.valueOf(readLine()!!)

    repeat(n) {
        val x = Integer.valueOf(readLine()!!)
        val r = x % 7
        val d = x / 7
        if(r == 0) {
            println(d)
        } else if(r == 1){
            println(d + 2)
        } else {
            println(d + 1)
        }
    }
}

private fun readInt() = readLine()?.toInt()!!

private fun rollTry(point: Int) =
    if (point in 2..7) 1
    else (point / 6) + if (point % 6 != 0) 1 else 0

fun main() {

    val num = readInt()
    (1..num)
        .map { readInt() }
        .forEach { println(rollTry(it)) }
}

fun readInt(): Int {
    return readLine()!!.toInt()
}

fun main() {
    val T = readInt()
    for(i in 1..T) {
        var result = 0
        var n = readInt()
        while(n > 0) {
            if(n % 7 == 1)
                n -= 4
            else if(n >= 7)
                n -= 7
            else
                n -= n % 7
            result++
        }
        println(result)
    }
}

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()

fun main() {
    val testCases = readInt()
    for (i in 1..testCases) {
        val n = readInt()
        println((n / 7) + 1)
    }
}

import java.io.*
import java.util.*
import java.lang.Math.*

var stok = StringTokenizer("")
var br = BufferedReader(InputStreamReader(System.`in`))

fun nextToken(): String? {
    while (!stok.hasMoreTokens()) {
        val s = br.readLine() ?: return null
        stok = StringTokenizer(s)
    }
    return stok.nextToken()
}

fun nextInt() = nextToken()!!.toInt()
fun nextDouble() = nextToken()!!.toDouble()
fun nextLong() = nextToken()!!.toLong()

fun main(args: Array<String>) {
    if (args.isNotEmpty()) br = BufferedReader(FileReader("input.txt"))
    PrintWriter(System.out, false).use { it.solve() }
}

fun PrintWriter.solve() {
    val t = nextInt()
    for (it in 0 until t) {
        val x = nextInt()
        if (x <= 7) {
            println(1)
        } else if (x % 2 == 0) {
            println(x / 2)
        } else {
            println(1 + (x - 3) / 2)
        }
    }
}

fun main(args: Array<String>){
    var t:Int = readLine()?.toInt()?:0
    for(i in 1..t)
    {
        var b:Int = readLine()?.toInt()?:0
        var result = b/2;
        println(result)
    }
}

fun main() {
    var t = readLine()!!.toInt()
    for (i in 1..t) {
        var number = readLine()!!.toInt()
        if (number % 2 == 0) {
            println(number / 2)
        } else {
            println((number - 1) / 2)
        }
    }
}

import java.util.*

fun main(args: Array<String>) {
        val scanner = Scanner(System.`in`)

        val n = scanner.nextInt()

        repeat(n){
            println(findNumberOfRoles(scanner.nextInt()))
        }
    }

    private fun findNumberOfRoles(q: Int): Int {
        return q/2
    }

import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)

    repeat(scanner.nextInt()){
        println(scanner.nextInt()/2)
    }
}

fun main() {
    val nQueries = readLine()!!.toInt()
    for (i in 0 until nQueries) {
        val value = readLine()!!.toInt()
        println(value / 7 + 1)
    }
}

import java.util.*

fun main() {

    val scanner = Scanner(System.`in`)
    var t = scanner.nextInt()

    while (t > 0) {
        t--
        val num = scanner.nextInt()
        var idx=2
        while (idx<=7){
            val c = num % idx
            val c2 = num / idx
            if (c != 1) {
                if (c > 0) println(c2 + 1)
                else println(c2)
                break
            }
            idx++
        }
    }
}

import java.util.*

fun main() {

    val scanner = Scanner(System.`in`)
    var t = scanner.nextInt()

    while (t > 0) {
        t--
        var num = scanner.nextInt()
        for (i in 2..7) {
            var c = num % i
            var c2 = num / i
            if (c != 1) {
                if (c > 0) println(c2 + 1)
                else println(c2)
                break
            }
        }
    }

}

import java.util.Scanner
fun main() {
        val read = Scanner(System.`in`)
        var t = read.nextInt()
        //var t : Int = 3
        while (t-- != 0) {
            var n = read.nextInt()
            var ans : Int = 0
            var i : Int
            for (i in 7 downTo 2) {
                if (n % i == 0) {
                    ans = n / i
                } else if (n % i >= 2 && n % i < i) {
                    ans = n / i + 1
                }
            }
            println(ans)
        }

    }

/* https://codeforces.com/problemset/problem/1093/A */

fun main() {
    val numOfQueries = readLine()!!.toInt()
    for (i in 1..numOfQueries) {
        val targetPoints = readLine()!!.toInt()
        val numOfRolls = targetPoints / 7 + 1
        println(numOfRolls)
    }
}

import kotlin.math.min

val dp = IntArray(103)

fun main(){
    dp[0] = 0
    for(i in 1..100){
        dp[i] = Int.MAX_VALUE
        for(j in 2..7)
            if(i >= j && dp[i-j] != Int.MAX_VALUE)
                dp[i] = min(dp[i], 1 + dp[i-j])
    }
    val t = readLine()!!.toInt()
    repeat(t){
        val x = readLine()!!.toInt()
        println(dp[x])
    }
}

fun main(){
    var t = readLine()!!.toInt()
    val answers = mutableListOf<String>()
    while (t-- > 0){
        val x = readLine()!!.toInt()
        answers.add((x/2).toString())
    }

    println(answers.joinToString("\n"))
}

fun main() {

    val solver = Solver()
//    val res = solver.solve(13)
//    print(res)
    val parsed: List<Int> = Parser().parse()
    val res = parsed.map { x -> solver.solve(x) }
    res.forEach{x-> println(x)}
}

class Solver {
    private val faces : List<Int> = listOf(2,3,4,5,6,7).reversed()

    fun solve(target: Int): Int {
        var currentTarget: Int = target
        var rollCount = 0
        while (currentTarget > 0) {
            val face = findNextFace(currentTarget)
            currentTarget -= face
            rollCount++
        }
        return rollCount
    }

    fun findNextFace(target : Int) : Int {
        val idx: Int = faces.size - 1
        var currentFace: Int = 0
        for (i: Int in 0..idx) {
            currentFace = faces[i]
            if (target >= currentFace) {
                return currentFace
            }
        }
        return currentFace
    }
}

class Parser {
    private fun lineSequence(limit: Int = Int.MAX_VALUE) = generateSequence { readLine() }.constrainOnce().take(limit)
    private fun readln() = readLine()!!
    private fun readlnInt() = readln().toInt()

    fun parse(): List<Int> {
        val queryNumber: Int = readlnInt()
        return lineSequence(queryNumber).map { x -> x.toInt() }.toList()
    }
}

import java.io.FileInputStream
import java.util.*

object programkt {
  @JvmStatic fun main(args: Array<String>) {
    if (args.size == 1)
      System.setIn(FileInputStream(args[0]))
    val sc = Scanner(System.`in`)
    val t = sc.nextInt()
    IntRange(1, t).forEach {
      val x = sc.nextInt()
      println(x / 2)
    }
  }
}

fun main() {
    var t = readLine()!!.toInt();
    while(t>0) {
            var x=readLine()!!.toInt();
            var ans=(x/7);
            var ans2=(x%7);
            if(ans2==0)
                println(ans);
            else
                println(ans+1);
                t--;
    }
}

fun main() {
    val t = readLine()!!.toInt()
    for (x in 0 until t) {
        val n=readLine()!!.toInt()
        println(n/2)
    }
}

//package com.happypeople.codeforces.c1093

import java.io.ByteArrayInputStream
import java.io.InputStream
import java.util.*

fun main(args: Array<String>) {
    try {
        A().run()
    } catch (e: Throwable) {
        A.log("" + e)
    }
}

class A {
    fun run() {
        val sc = Scanner(systemIn())
        val n=sc.nextInt()
        (1..n).forEach {
            val i=sc.nextInt()
            val rolls=if(i==2) 1 else i/3
            println("$rolls")
        }
    }

    companion object {
        var inputStr: String? = null

        fun systemIn(): InputStream {
            if (inputStr != null)
                return ByteArrayInputStream(inputStr!!.toByteArray())
            else
                return System.`in`
        }

        var printLog = false
        fun log(str: String) {
            if (printLog)
                println(str)
        }
    }
}

import java.util.Scanner

object programkt {
    @JvmStatic fun main(args:Array<String>) {
        val sc = Scanner(System.`in`)
        val t = sc.nextInt()
        for (i in 0 until t)
        {
            val x = sc.nextInt()
            if (x <= 7)
            {
                println(1)
            }
            else
            {
                println(x / 2)
            }
        }
    }
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 1..n) {
        val t1 = readLine()!!.toInt()
        println(getCount(t1))
    }
}

fun getCount(x: Int): Int {
    var c = 0
    var s = x
    if (x % 2 != 0) {
        s -= 3
        c++
    }
    c += s / 2
    return c
}

fun main() {
    repeat(readLine()!!.toInt()) {
        val n = readLine()!!.toInt();
        println("${n/2}");
    }
}

import java.io.BufferedReader
import java.io.File
import kotlin.system.measureTimeMillis

fun solve(input: BufferedReader) {
    val t = input.readLine().toInt()
    for (i in 0 until t) {
        val n = input.readLine().toInt()
        println(n / 2)
    }
}

fun main(args: Array<String>) {
    System.err.println("time = ${measureTimeMillis {
        solve(System.`in`.bufferedReader())
//        solve(File("a.out").`bufferedReader())
    }}ms")
}

fun main() {
    fun readInt() = readLine()!!.toInt()

    val numQueries = readInt()
    val sol = IntArray(numQueries)
    for (query in 0 until numQueries) {
        val x = readInt()
        sol[query] = x / 7 + if (x % 7 == 0) 0 else 1
    }
    print(sol.joinToString(System.lineSeparator()))
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    BufferedReader(InputStreamReader(System.`in`)).use { reader ->
        val count = reader.readLine().toInt()
        reader.lineSequence()
            .take(count)
            .map {
                it.toInt() / 2
            }.joinToString(separator = "\n") {
                it.toString()
            }
            .let(::println)
    }
}

/*
fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    repeat(t) {
        val x = readLine()!!.toInt()
        println((x + 6) / 7)
    }
}
*/
fun main(args: Array<String>){
    var i = 1;
    var t: Int =Integer.valueOf(readLine())
    repeat(t)
    {
        var x: Int =Integer.valueOf(readLine())
        println((x-1)/7 + 1)
    }
}

fun main(args: Array<String>) {
    val out = generateSequence(::readLine)
        .drop(1)
        .mapNotNull{it?.toInt()}
        .map{it / 7 + 1}
        .joinToString("\n")

    print(out)
}

fun calcurate(sum: Int): Int {
    val quotient = sum / 7
    val mod = sum % 7 // 7で割った余り
    return when {
        /*
         * 1は出せないので割る数を減らす -> quotient - 1
         * 8余るので6で割る -> +1
         * 2余る -> +1
         * => quotient - 1 + 1 + 1
         */
        mod == 1 -> quotient  + 1
        /*
         * 2〜6余る -> +1
         */
        else -> quotient + 1
    }
}

fun dice(input: Sequence<String?>): String {
    return input.drop(1)
        .mapNotNull{it?.toInt()}
        .map(::calcurate)
        .joinToString("\n")
}

fun main(args: Array<String>) {
    print(dice(generateSequence(::readLine)))
}

fun main() {
    val n = readLine()!!.toInt()
    for(i in 0 until n){
        val x = readLine()!!.toInt()
        println((x+6)/7)
    }
}

fun main() {
    val t = readLine()!!.toInt()
    repeat((1..t).count()) {
        val n = readLine()!!.toInt()
        println(n/7 + if(n.rem(7) == 0) 0 else 1 )
    }
}

import kotlin.math.sign

class DiceRolling {
    data class Problem(val id: Int, val target: Int)

    data class Solution(val count: Int) {
        override fun toString(): String {
            return "$count\n"
        }
    }

    fun readProblem(problemId: Int): Problem {
        return Problem(problemId, readLine()!!.toInt())
    }

    fun solveProblem(problem: Problem): Solution {
        return Solution(problem.target / 7 + (problem.target % 7).sign)
    }
}

fun main() {
    val diceRolling = DiceRolling()
    val n = readLine()!!.toInt()
    (1..n).map(diceRolling::readProblem)
        .map(diceRolling::solveProblem)
        .onEach(::print)
}

import kotlin.math.sign

data class Problem(val id: Int, val target: Int)

data class Solution(val count: Int) {
    override fun toString(): String {
        return "$count\n"
    }
}

fun readProblem(problemId: Int): Problem {
    return Problem(problemId, readLine()!!.trim().toInt())
}

fun solveProblem(problem: Problem): Solution {
    return Solution(problem.target / 7 + (problem.target % 7).sign)
}

fun main(args: Array<String>) {
    var n = readLine()!!.toInt()
    (1..n).map(::readProblem)
        .map(::solveProblem)
        .onEach(::print)
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val T = readInt()
    for (t in 0..T-1) {
        val n = readInt()
        println(n / 2)
    }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val T = readInt()
    val output = mutableListOf<String>()
    for (t in 0..T-1) {
        val n = readInt()
        output += "${n/2}"
    }
    println(output.joinToString("\n"))
}

fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    repeat(t) {
        val x = readLine()!!.toInt()
        println((x + 6) / 7)
    }
}

fun main(args: Array<String>) {
    val count = readLine()!!.toInt()
    for (i in 0 until count) {
        val target = readLine()!!.toInt()
        val roll = Math.ceil(target / 7.0).toInt()
        println(roll)
    }
}

fun main() {
    readLine()?.toInt()?.let {
        repeat(it) {
            readLine()?.toInt()?.let {
                println(1 + it / 7)
            }
        }
    }
}

import kotlin.math.sign

fun main() {
    repeat(readInt()) {
        val n = readInt()
        println(n / 7 +  (n % 7).sign)
    }
}

fun readInt() = readLine()?.toInt() ?: 0

fun main() {
    val n = readLine()!!.toInt()
    repeat (n) {
        val i = readLine()!!.toInt()
        println(1+i/7)
    }
}

object programkt {

    @JvmStatic
    fun main(args: Array<String>) {
        val t = readLine()!!.toInt()

        for (i in 0 until t) {
            val x = readLine()!!.toInt()
            println(x / 2)
        }
    }

}

fun rollCount(score: Int, base: Int = 7): Int {
    if(score <= 7) {
        return 1
    }
    val ost = score % base
    val full = score / base
    return when(ost) {
        0 -> full
        1 -> (full-1) + rollCount(score - (full-1)*base, base-1)
        else -> full + 1
    }
}

fun main() {
    val count = readLine()!!.toInt()
    repeat(count) {
        val score = readLine()!!.toInt()
        println(rollCount(score))
    }
}

fun main(args: Array<String>) {
    var n = readLine()!!.toInt()
//    var arr2 = readLine()!!.split(" ").map { x -> x.toLong() }
//    var arr = readLine()!!.split(" ").map { x -> x.toLong() }

    for (a in 0 until n) {
        var count = readLine()!!.toInt()
        if (count < 8) println (1)
        else println(count / 7 + 1)
    }

}

fun main() {
    val n = Integer.valueOf(readLine()!!)

    repeat(n) {
        val x = Integer.valueOf(readLine()!!)
        if(x % 7 == 0) {
            println(x / 7)
        } else if(x % 7 == 1){
            println(x / 7 + 2)
        } else {
            println(x / 7 + 1)
        }
    }
}

fun main() {
    val n = readLine()!!.toInt()
    repeat(n) {
        val x = readLine()!!.toInt()
        val res = if (x > 7) {
            x/7 + 1
        } else 1
        println(res)
    }
}

fun x()=readLine()!!.toInt()
fun main()=repeat(x()){println(x()/2)}

fun main() {
    val n = readInt()
    for (j in 1..n) {
        val v = readInt()
        println(v / 2)
    }
}

fun readln() = readLine()!!
fun readlnByte() = readln().toByte()
fun readlnShort() = readln().toShort()
fun readlnInt() = readln().toInt()
fun readlnLong() = readln().toLong()
fun readlnFloat() = readln().toFloat()
fun readlnDouble() = readln().toDouble()
fun readlnBigInt(radix: Int = 10) = readln().toBigInteger(radix)
fun readlnBigDecimal() = readln().toBigDecimal()

fun lineSequence(limit: Int = Int.MAX_VALUE) = generateSequence { readLine() }.constrainOnce().take(limit)
fun readlnStrings() = readln().split(' ')
fun readlnBytes() = readlnStrings().map { it.toByte() }
fun readlnShorts() = readlnStrings().map { it.toShort() }
fun readlnInts() = readlnStrings().map { it.toInt() }
fun readlnLongs() = readlnStrings().map { it.toLong() }
fun readlnFloats() = readlnStrings().map { it.toFloat() }
fun readlnDoubles() = readlnStrings().map { it.toDouble() }

fun readByteArray() = readlnStrings().run { ByteArray(size) { get(it).toByte() } }
fun readShortArray() = readlnStrings().run { ShortArray(size) { get(it).toShort() } }
fun readIntArray() = readlnStrings().run { IntArray(size) { get(it).toInt() } }
fun readLongArray() = readlnStrings().run { LongArray(size) { get(it).toLong() } }
fun readFloatArray() = readlnStrings().run { FloatArray(size) { get(it).toFloat() } }
fun readDoubleArray() = readlnStrings().run { DoubleArray(size) { get(it).toDouble() } }

fun readlnByteArray(n: Int) = ByteArray(n) { readlnByte() }
fun readlnShortArray(n: Int) = ShortArray(n) { readlnShort() }
fun readlnIntArray(n: Int) = IntArray(n) { readlnInt() }
fun readlnLongArray(n: Int) = LongArray(n) { readlnLong() }
fun readlnFloatArray(n: Int) = FloatArray(n) { readlnFloat() }
fun readlnDoubleArray(n: Int) = DoubleArray(n) { readlnDouble() }

fun readByteArray2d(rows: Int, cols: Int) = Array(rows) { readByteArray().also { require(it.size == cols) } }
fun readShortArray2d(rows: Int, cols: Int) = Array(rows) { readShortArray().also { require(it.size == cols) } }
fun readLongArray2d(rows: Int, cols: Int) = Array(rows) { readLongArray().also { require(it.size == cols) } }
fun readIntArray2d(rows: Int, cols: Int) = Array(rows) { readIntArray().also { require(it.size == cols) } }
fun readFloatArray2d(rows: Int, cols: Int) = Array(rows) { readFloatArray().also { require(it.size == cols) } }
fun readDoubleArray2d(rows: Int, cols: Int) = Array(rows) { readDoubleArray().also { require(it.size == cols) } }

fun isWhiteSpace(c: Char) = c in " \r\n\t"

// JVM-only targeting code follows next

// readString() via sequence is still slightly faster than Scanner
fun readString() = generateSequence { System.`in`.read().toChar() }
    .dropWhile { isWhiteSpace(it) }.takeWhile { !isWhiteSpace(it) }.joinToString("")

fun readByte() = readString().toByte()
fun readShort() = readString().toShort()
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readFloat() = readString().toFloat()
fun readDouble() = readString().toDouble()
fun readBigInt(radix: Int = 10) = readString().toBigInteger(radix)
fun readBigDecimal() = readString().toBigDecimal()

fun readBytes(n: Int) = generateSequence { readByte() }.take(n)
fun readShorts(n: Int) = generateSequence { readShort() }.take(n)
fun readInts(n: Int) = generateSequence { readInt() }.take(n)
fun readLongs(n: Int) = generateSequence { readLong() }.take(n)
fun readFloats(n: Int) = generateSequence { readFloat() }.take(n)
fun readDoubles(n: Int) = generateSequence { readDouble() }.take(n)

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = readLine()!!.toInt()
    for(x in 0..n-1){
    	val tmp = readLine()!!.toInt()
    	if(tmp <= 6) println("1")
    	else{
    		println(tmp/6+1)
    	}
    }

}

import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.StringTokenizer

    internal var br = BufferedReader(InputStreamReader(System.`in`))
    internal var st: StringTokenizer? = null
    internal var out = PrintWriter(System.out)

    @Throws(IOException::class)
    private fun solve() {
        val t = nextInt()
        for (i in 0 until t) {
            val x = nextInt()
            out.println(x / 2)
        }
    }

    internal fun next(): String {
        while (st == null || !st!!.hasMoreTokens()) {
            st = StringTokenizer(br.readLine())
        }
        return st!!.nextToken()
    }

    @Throws(IOException::class)
    internal fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    @Throws(IOException::class)
    internal fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    @Throws(IOException::class)
    private fun run() {
        solve()
        out.close()
    }

        fun main(args: Array<String>) {
            run()
        }

fun main(arg: Array<String>){
	var n = readLine()!!.toInt()
	while (n > 0){
		val x = readLine()!!.toInt()
		val y = if(x.rem(7)==0) x/7 else x/7+1
		println(y)
		n = n - 1
	}
}

fun main()
{
	var s= arrayOf(2,3,4,5,6,7)
	var t=readLine()!!.toInt()
	repeat(t)
	{   var c: Int=0
		var p: Int=readLine()!!.toInt()
		while (p>0)
			{
		       if(p>7)
				   {   p=p-s.random()
					   c++
							}
				else
				   {   c++
					   p=0
							}
	        }
		println(c)
	}
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    var T = readInt()
    while(T>0) {
        var x = readInt()
        println("%d".format(x/2))
        T--
    }

}

fun main(){
    fun x()=readLine()!!.toInt()
    for(i in 1..x())println(x()/2)
}

import java.util.*
import kotlin.collections.ArrayList
//https://www.javatpoint.com/kotlin-smart-cast
fun main() {
    val read=Scanner(System.`in`);
    var test=read.nextInt();
    while((test--)>0){
        var x=read.nextInt();
        var cnt=0;
        if(x%2==1){
            x-=3;
            cnt+=1;
        }
        cnt+=x/2;
        println(cnt);
    }
}

fun main(args:  Array<String>)
{
val t=readLine()!!.toInt()
repeat(t)
{
val n=readLine()!!.toInt()

println(n/2);

}
}

fun main(args: Array<String>)
{
val t= readLine()!!.toInt()
repeat(t)
{
val x= readLine()!!.toInt()
println(x/2)
}

}

fun main(args : Array<String>) {
    val numberOfQueries = readLine()!!.toInt()

    for (i in 1..numberOfQueries) {
        println(readLine()!!.toInt() / 2)
    }
}

fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    repeat(t) {
        val x = readLine()!!.toInt()
        if (x % 2 == 0){
            println(x / 2)
        }else{
            var a = x - 3
            println(a / 2 + 1)
        }
    }
}

fun main() {
    for (i in 1..readLine()!!.toInt()) {
        println(readLine()!!.toInt() / 2)
    }
}

fun main(args : Array<String>) {
    val numberOfQueries = readLine()!!.toInt()

    for (i in 1..numberOfQueries) {
        val points = readLine()!!.toInt()

        if (points % 2 == 0) {
            println(points / 2)
        } else {
            println((points - 3) / 2 + 1)
        }
    }
}

import java.io.File

class MyReader(fileName: String) {
    val file = File(fileName)

    val contents : List<String>?

    init {
        contents = try {
            file.readLines()
        } catch (e : Throwable) {
            null
        }
    }

    val line : String
    get() {
        return if (contents != null) {
            contents[pointer++]
        } else {
            readLine()!!
        }
    }

    var pointer = 0
}

var reader : MyReader = MyReader("src/inpsut.txt")

fun getLine() = reader.line
fun readInt() = getLine().toInt()
fun readInts() = getLine().split(" ").map { it.toInt() }

fun main() {
    val n = readInt()
    repeat(n) { i ->
        var num = readInt()
        var ans = 0
        if (num % 2 == 1) {
            ans = 1
            num -= 3
        }
        println(num / 2 + ans)
    }
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 0 until n) {
        val t = readLine()!!.toInt()
        if (t <= 7) {
            println(1)
            continue
        }
        val s = t / 7
        val rem = t % 7
        if (rem == 0) {
            println(s)
        } else {
            println(s + 1)
        }
    }
}

fun main() {
    for (i in 1..readLine()!!.toInt()) {
        val r: Int = readLine()!!.toInt() / 2
        println(r)
    }
}

fun main() {
    val numberOfQueries = readLine()!!.toInt()
    val output = mutableListOf<Int>()

    repeat(numberOfQueries) {
        val target = readLine()!!.toInt()

        val result = when {
            target < 8 -> 1
            target % 7 == 0 -> target / 7
            else -> ((target - (target % 7)) / 7) + 1
        }

        output.add(result)
    }

    output.forEach { x -> println(x) }
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 0 until n) {
        val x = readLine()!!.toInt()
            println(x/2)
    }
}

fun readInt(separator: Char = ' ') = readLine()!!.toInt()
fun main() {
    val n = readInt()
    for(i in 0 until n){
        val x = readInt()/2
        println("$x")
    }
}

fun main() {
   var n = readLine()!!.toInt()
   while (n > 0) {
      val t = readLine()!!.toInt()
      println(t / 2)
      n -= 1
   }
}

import java.io.*
import java.util.*

object programkt {
    @JvmStatic
    fun main(args: Array<String>) {
        val inputStream = System.`in`
        val outputStream = System.out
        val `in` = InputReader(inputStream)
        val out = OutputWriter(outputStream)
        val solver = Problem()
        solver.solve(`in`, out)
        out.close()
    }

    internal class Problem {
        fun solve(`in`: InputReader, out: OutputWriter) {
            val t = `in`.readInt()
            val x = IntArray(t)
            for (i in 0 until t) x[i] = `in`.readInt()
            for (i in 0 until t) out.printLine(x[i] / 2)
        }
    }

    internal class InputReader(private val stream: InputStream) {
        private val buf = ByteArray(1024)
        private var curChar: Int = 0
        private var numChars: Int = 0
        private val filter: SpaceCharFilter? = null

        fun read(): Int {
            if (numChars == -1)
                throw InputMismatchException()
            if (curChar >= numChars) {
                curChar = 0
                try {
                    numChars = stream.read(buf)
                } catch (e: IOException) {
                    throw InputMismatchException()
                }

                if (numChars <= 0)
                    return -1
            }
            return buf[curChar++].toInt()
        }

        fun readInt(): Int {
            var c = read()
            while (isSpaceChar(c))
                c = read()
            var sgn = 1
            if (c == '-'.toInt()) {
                sgn = -1
                c = read()
            }
            var res = 0
            do {
                if (c < '0'.toInt() || c > '9'.toInt())
                    throw InputMismatchException()
                res *= 10
                res += c - '0'.toInt()
                c = read()
            } while (!isSpaceChar(c))
            return res * sgn
        }

        fun readLong(): Long {
            var c = read()
            while (isSpaceChar(c))
                c = read()
            var sgn = 1
            if (c == '-'.toInt()) {
                sgn = -1
                c = read()
            }
            var res: Long = 0
            do {
                if (c < '0'.toInt() || c > '9'.toInt())
                    throw InputMismatchException()
                res *= 10
                res += (c - '0'.toInt()).toLong()
                c = read()
            } while (!isSpaceChar(c))
            return res * sgn
        }

        fun readString(): String {
            var c = read()
            while (isSpaceChar(c))
                c = read()
            val res = StringBuilder()
            do {
                res.appendCodePoint(c)
                c = read()
            } while (!isSpaceChar(c))
            return res.toString()
        }

        fun isSpaceChar(c: Int): Boolean {
            return filter?.isSpaceChar(c)
                ?: (c == ' '.toInt() || c == '\n'.toInt() || c == '\r'.toInt() || c == '\t'.toInt() || c == -1)
        }

        operator fun next(): String {
            return readString()
        }

        interface SpaceCharFilter {
            fun isSpaceChar(ch: Int): Boolean
        }
    }

    internal class OutputWriter {
        private val writer: PrintWriter

        constructor(outputStream: OutputStream) {
            writer = PrintWriter(BufferedWriter(OutputStreamWriter(outputStream)))
        }

        constructor(writer: Writer) {
            this.writer = PrintWriter(writer)
        }

        fun print(vararg objects: Any) {
            for (i in objects.indices) {
                if (i != 0)
                    writer.print(' ')
                writer.print(objects[i])
            }
        }

        fun printLine(vararg objects: Any) {
            print(*objects)
            writer.println()
        }

        fun close() {
            writer.close()
        }
    }
}

import java.util.*

fun main(args: Array<String>) {
    val input = Scanner(System.`in`)
    var rows = input.nextInt()
    var row = 0
    do {
        row = input.nextInt()
        if (row < 8) {
            println(1)
        } else {
            println(row / 2)
        }
        --rows
    } while(rows > 0)
}

fun main() {
    for (i in 1..r())
        println(r() / 2)
}

inline fun r() = readLine()!!.toInt()

import java.util.*
import java.io.*
fun main(args:Array<String>) {
	val sc = Scanner(System.`in`)
	// PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	var x = sc.nextInt();
	while (x-- > 0)
	{
		val t = sc.nextInt();
		val ans:Int
		if (t % 2 == 0)
		  ans = t / 2
		else
		  ans = (t - 3) / 2 + 1
		println(ans)
		// x -= 1;
	 // out.write(ans);
	}
// out.close();
}

fun main() {
    val tests = readLine()!!.toInt();
    repeat(tests) {
        val points = readLine()!!.toInt()
        print((points / 7) + 1)
    }
}

import java.util.*

fun main(){
    val scanner = Scanner(System.`in`)
    var queries = scanner.nextInt()
    var queryList = arrayListOf<Int>()

    if(queries<=100) {
        while (queries > 0) {
            val contest = scanner.nextInt()
            if(contest in 2..100)
            {queryList.add(contest)}
            queries--
        }
    }
    for(elem in queryList){
        rollDice(elem)
    }
}

val diceEyes = listOf(2,3,4,5,6,7)

val evenEyes = listOf(2,4,6)

fun rollDice(number: Int): List<Int>{
    val rolls = mutableListOf<Int>()
    var sum = 0
    var i = 0
    if(number % 2 == 0){
        i = evenEyes.size-1
    }else{
        i = diceEyes.size-1
    }
    while(sum != number && i >= 0){
        var tempSum = sum
        if(number % 2 == 0){
            tempSum+=evenEyes[i]
        }else{
            tempSum += diceEyes[i]
        }

        if(tempSum <= number){
            sum = tempSum
            rolls.add(diceEyes[i])
        }else{
            i--
        }
    }
    println("${rolls.size}")
    return rolls
}

import kotlin.random.Random

fun main(args: Array<String>) {
   args.slice(1 until args.size).forEach{
       var number = it.toInt()
       var counter = 0
       while( number > 7 ){
           number -= Random.nextInt(2, 7)
           counter++
       }
       println(counter)
   }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val T = readInt()
    for (t in 0..T-1) {
        val n = readInt()
        println((n + 1) / 2)
    }
}

fun main() {
    var t = Integer.parseInt(readLine())

    while(t > 0) {
        var res = solve(Integer.parseInt(readLine()))
        println(res)
        t--
    }

}

fun solve(n:Int):Int {
    var res = 0
    var m = n
    for(i in 7 downTo 2) {
        res += m/i
        m %= i
    }
    return res
}

fun main(){
    val roundCount = readLine()!!
    val length = roundCount.length
    if (length == 1){
        if (roundCount.toInt() == 2 || roundCount.toInt() == 3)
            println("1")
        else
            println("2")

        return
    }
    println(roundCount.substring(0, roundCount.length-1).toInt() * 2)

}

fun main() {
    val parsed: List<Int> = Parser().parse()
    val solver = Solver()
    val res = parsed.map { x -> solver.solve(x) }
    res.forEach{x-> println(x)}
}

class Solver {
    private val faces : List<Int> = listOf(2,3,4,5,6,7)

    fun solve(target : Int) : Int {
        var idx: Int = faces.size - 1
        var rollCount = 1
        var currentTarget: Int = target
        for (i: Int in 0..idx) {
            val currentFace: Int = faces[idx]
            if (currentTarget < currentFace) {
                continue
            }
            currentTarget -= currentFace
            rollCount++
        }
        return rollCount
    }
}

class Parser {
    private fun lineSequence(limit: Int = Int.MAX_VALUE) = generateSequence { readLine() }.constrainOnce().take(limit)
    private fun readln() = readLine()!!
    private fun readlnInt() = readln().toInt()

    fun parse(): List<Int> {
        val queryNumber: Int = readlnInt()
        return lineSequence(queryNumber).map { x -> x.toInt() }.toList()
    }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    var T = readInt()
    while(T>0) {
        var x = readInt()
        println("%d".format(x/2+x%2))
        T--
    }

}

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = readLine()!!.toInt()
    for(x in 0..n-1){
    	val tmp = readLine()!!.toInt()
    	if(tmp <= 6) println("1")
    	else{
    		println(tmp/6+tmp%6)
    	}
    }

}

import java.util.*

fun main() {
    val sc = Scanner(System.`in`)
    val t = sc.nextInt()
    repeat(t) {
        val x = sc.nextInt()
        println((x-1)/2+1)
    }//
}

fun main(args: Array<String>) = args.forEach { println(it) }

fun calculate(target: Int): Int {
    var nums = listOf(7, 6, 5, 4, 3, 2)
    var currentTarget = target
    var throws = 0
    while (nums.isNotEmpty()) {
        while (currentTarget >= nums.first()) {
            currentTarget -= nums.first()
            throws++
        }
        nums = nums.drop(1)
    }
    return throws
}

fun main(args: Array<String>) {
    repeat(readLine()!!.toInt()) {
        println(calculate(readLine()!!.toInt()))
    }
}

import java.util.*

fun main(){
    val scanner = Scanner(System.`in`)
    var queries = scanner.nextInt()
    if(queries<=100) {
        while (queries > 0) {
            val contest = scanner.nextInt()
            if(contest in 2..100)
            {rollDice(contest)}
            queries--
        }
    }
}

val diceEyes = listOf(2,3,4,5,6,7)

fun rollDice(number: Int): List<Int>{
    val rolls = mutableListOf<Int>()
    var sum = 0
    var i = diceEyes.size-1
    while(sum != number && i >= 0){
        var tempSum = sum
        tempSum += diceEyes[i]
        if(tempSum <= number){
            sum = tempSum
            rolls.add(diceEyes[i])
        }else{
            i--
        }
    }
    println("${rolls.size}")
    return rolls
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 0 until n) {
        val x = readLine()!!.toInt()
        val t = x / 2
        if (t*2 == x) {
            println(t)
        } else {
            println(t+1)
        }
    }
}

import java.util.*

fun main(){
    val scanner = Scanner(System.`in`)
    var queries = scanner.nextInt()
    while (queries >0){
        rollDice(scanner.nextInt())
        queries--
    }
}

val diceEyes = listOf(2,3,4,5,6,7)

fun rollDice(number: Int): List<Int>{
    val rolls = mutableListOf<Int>()
    var sum = 0
    var i = diceEyes.size-1
    while(sum != number && i >= 0){
        var tempSum = sum
        tempSum += diceEyes[i]
        if(tempSum <= number){
            sum = tempSum
            rolls.add(diceEyes[i])
        }else{
            i--
        }
    }
    println("${rolls.size}")
    return rolls
}

fun main() {
    val n = readLine()!!.toInt()
    repeat (n) {
        readLine()!!.toInt()
        println(n)
    }
}

fun main()
{
    val t = readLine()!!.toInt()
    for (i in 1 .. t)
    {
        println(treatTestCase())
    }
}

fun treatTestCase(): String
{
    val x = readLine()!!.toInt()

    // if even, return divided by 2
    // else if its 3 return 1
    // else remove three then return divided by 2 + 1

    return when
    {
        x % 2 == 0 ->
        {
            println("Roll 2 ${x / 2} times")
            (x / 2).toString()
        }
        x == 3     ->
        {
            println("Roll 3 once")
            (1).toString()
        }
        else       ->
        {
            println("Roll 3 once and 2 ${(x - 3) / 2} times")
            ((x - 3) / 2 + 1).toString()
        }
    }
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    BufferedReader(InputStreamReader(System.`in`)).lineSequence().drop(1).map {
        it.toInt() / 2
    }.joinToString {
        it.toString()
    }.let(::println)
}

import java.util.*

fun main(args: Array<String>) = with(Scanner(System.`in`)) {
    val t = nextInt()
    val x = nextInt()
    println(x)
}

fun main(args: Array<String>) {
    val numOfLines = readLine()!!.toInt()

    (0 until numOfLines)
        .map { readLine()!!.toInt() }
        .forEach {query ->
            val answer = query % 7 + 1
            println(answer)
        }

}

fun main(args : Array<String>){
    if (args.isNotEmpty()) {
        for (i in 1..args[0].toInt()) {
            println(args[i].toInt() / 7)
        }
    }
}

fun main()
{
    var n = readLine()!!.toInt()

    for (i in 1..n)
    {
        var x = readLine()!!.toInt()

        var j = 0

        while (x >= 6)
        {
            j++
            x -= 6
        }

    }
}

fun main() {
    var t = Integer.parseInt(readLine())

    while(t > 0) {
        var res = solve(Integer.parseInt(readLine()))
        println(res)
        t--
    }

}

fun solve(n:Int):Int {
    var res = 0
    var m = n
    for(i in 7 downTo 2) {
        res += m/i
        m %= i
    }
    return res
}

fun main() {

    val queries = readLine()!!.toInt()

    for (i in 0 until queries) {
        val points = readLine()!!.toInt()

        val maxRolls = Math.ceil(points / 2.0)

        println(maxRolls.toInt())
    }

}

val sides = arrayOf(2, 3, 4, 5, 6, 7)
val output = mutableListOf<Int>()

fun main() {

    val requestCounts = readInt()
    for (i in 0 until requestCounts) {
        val number: Int  = readInt()
        calculateAttemptCounts(number)
    }

    for (out in output) {
        println(out)
    }
}

fun readInt(): Int {
    return readLine()!!.toInt()
}

fun calculateAttemptCounts(number: Int) {
    var tempNumber = number
    var attemptCounts = 0
    for (side in sides.reversedArray()) {
        val tempCount: Int = tempNumber / side

        if (tempCount == 0) continue

        attemptCounts += tempCount

        if (tempNumber % side == 0) {
            output.add(attemptCounts)
            break
        }

        tempNumber %= side
    }
}

fun main() {
    val MIN_VAL = 2
    val MAX_VAL = 7
    val N = readLine()!!.toInt()
    val scores: MutableList<Int> = ArrayList()
    for (i in 0 until N) {
        scores.add(readLine()!!.toInt())
    }
    val answer: MutableList<Int> = ArrayList()

    scores.forEach {
        var currentScore = MAX_VAL
        var currentAmountScore = it
        var amountSteps = 0

        while (currentAmountScore >= 0 && currentScore >= MIN_VAL) {
            while (currentScore <= currentAmountScore) {
                currentAmountScore -= currentScore
                amountSteps++
            }
            currentScore--
        }
        answer.add(amountSteps)
    }
    answer.forEach(::println)
}

fun getInputs(): List<Int> {
    val count = readLine()!!
    return List(count.toInt()) { readLine()!!.toInt() }
}

fun calculate(target: Int): Int {
    var nums = listOf(7, 6, 5, 4, 3, 2)
    var currentTarget = target
    var throws = 0
    while (nums.isNotEmpty()) {
        while (currentTarget >= nums.first()) {
            currentTarget -= nums.first()
            throws++
        }
        nums = nums.drop(1)
    }
    return throws
}

fun main(args: Array<String>) {
    val queries = getInputs()
    queries.forEach { println(calculate(it)) }
}

import java.util.Scanner
fun main(args:Array<String>) {
    val read = Scanner(System.`in`)
       val n:Int = read.nextInt()
       val ans = n/2 + n%2
      println("$ans")

}

fun main() {
    val solver = Solver()
    val res = solver.solve(100)
    println(res)
}

class Solver {
    private val faces : List<Int> = listOf(2,3,4,5,6,7)

    fun solve(target : Int) : Int {
        var idx: Int = faces.size - 1
        var rollCount = 1
        var currentTarget: Int = target
        for (i: Int in 0..idx) {
            val currentFace: Int = faces[idx]
            if (currentTarget < currentFace) {
                continue
            }
            currentTarget -= currentFace
            rollCount++
        }
        return rollCount
    }
}

class Parser {
    private fun lineSequence(limit: Int = Int.MAX_VALUE) = generateSequence { readLine() }.constrainOnce().take(limit)
    private fun readln() = readLine()!!
    private fun readlnInt() = readln().toInt()

    fun parse(): List<Int> {
        val queryNumber: Int = readlnInt()
        return lineSequence(queryNumber).map { x -> x.toInt() }.toList()
    }
}

fun main(args: Array<String>) {
    val countLine = readLine()
    println(countLine)
}

fun main(){
    val points = readLine()!!.toInt()
    print((points/7)+1)
}

fun main(){
    val roundCount = readLine()?.toIntOrNull()
    roundCount?.let {count->
        val arrayOfPoints = Array(3){
            readLine()?.toIntOrNull()
        }
        arrayOfPoints.forEach {
            it?.let {
                println(it/2)
            }
        }
    }
}

import java.util.*

fun main(){
    val scanner = Scanner(System.`in`)
    var queries = scanner.nextInt()
    if(queries<=100) {
        while (queries > 0) {
            rollDice(scanner.nextInt())
            queries--
        }
    }
}

val diceEyes = listOf(2,3,4,5,6,7)

fun rollDice(number: Int): List<Int>{
    val rolls = mutableListOf<Int>()
    var sum = 0
    var i = diceEyes.size-1
    while(sum != number && i >= 0){
        var tempSum = sum
        tempSum += diceEyes[i]
        if(tempSum <= number){
            sum = tempSum
            rolls.add(diceEyes[i])
        }else{
            i--
        }
    }
    println("${rolls.size}")
    return rolls
}

import java.util.Scanner
object programkt {
  @JvmStatic fun main(args:Array<String>) {
    val sc = Scanner(System.`in`)
    val tc = sc.nextInt()
    for (i in 1..tc)
    {
      val n = sc.nextInt()
      println(n)
    }
  }
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 1..n) {
        val x = readLine()!!.toInt()
        when {
            x < 8 -> print(1)
            x % 2 == 0 -> print(x / 2)
            else -> print((x - 3) / 2 + 1)
        }
    }
}

fun main(args: Array<String>) {
   args.slice(1 until args.size).forEach{
       var number = it.toInt()
       var counter = 0
       while( number > 0 ){
           number -= 7
           counter++
       }
       println(counter)
   }
}

import com.sun.org.apache.xpath.internal.operations.Bool

fun main(args: Array<String>) {
    val scanner = java.util.Scanner(System.`in`)
    var inputCount = scanner.nextLine()
    val count = inputCount.toInt()
    var inputList = ArrayList<Int>(count)

    val minBoneValue = 2
    val maxBoneValue = 7
    val minValue = 1

    for (x in minValue..count) {
        var value = scanner.nextLine()
        inputList.add(value.toInt())
    }

    for (x in inputList) {
        if(x >= minBoneValue && x <= maxBoneValue){
            println(minValue)
        }
        else {
            var throwsCount = (x/maxBoneValue)
            val remainder = x%maxBoneValue
            if(remainder != minValue)
                throwsCount++
            println(throwsCount)
        }
    }
}

fun main(args : Array<String>) {
    if (args.isNotEmpty()) {
        Array(args[0].toInt()) { i ->(args[i+1].toInt()/7)+1 }.forEach(::println)
    }
}

val scan = java.util.Scanner(System.`in`)
fun main(args: Array<String>) {
    var t = scan.nextInt()
    repeat(t) {
        var n = scan.nextInt()
        var f = IntArray(n + 7, {0})
        f[0] = 0
        f[1] = 1
        for (i in 2..6) {
            f[i] = 1
        }
        for (i in 7..n) {
            f[i] = Math.min(Math.min(Math.min(f[i - 2], f[i - 3]), Math.min(f[i - 4], f[i - 5])), f[i - 6]) + 1
        }
        print(f[n])
    }
}

fun main() {
    println(numRolls(2))
    println(numRolls(13))
    println(numRolls(37))
    println(numRolls(100))
}

private fun numRolls(points: Int): Int {
    var numRolls = 0
    var remainingPoints = points
    for (i in 2..7) {
        var rolls = remainingPoints / i
        while (rolls > 0) {
            numRolls += rolls
            remainingPoints %= i
            rolls = remainingPoints / i
        }
    }
    return numRolls
}

fun main(args : Array<String>){
    if (args.isNotEmpty()) {
        for (i in 1..args[0].toInt()) {
            println(args[i].toInt() / 7)
        }
    }
}

fun main() {
          val t = readInt()
    for (i in 1..t) {
        val summ = readLine()!!.toInt()
        recCal(summ)
    }
  }

fun recCal(value: Int): Int {
    return when {
        value in 2..7 ->  1
        value == 8 ->  2
        else -> 1 + recCal(value - 7)

    }
}
fun check(value: Int, m: Int) = (value / m) * m + (value % m)
fun readInt() = readLine()!!.toInt()

fun main() {
    val tests = readLine()!!.toInt();
    repeat(tests) {
        val points = readLine()!!.toInt()
        print((points / 7) + 1)
    }
}

val sides = arrayOf(2, 3, 4, 5, 6, 7)
val output = mutableListOf<Int>()

fun main() {

    val requestCounts = readInt()
    for (i in 0 until requestCounts) {
        val number: Int  = readInt()
        calculateAttemptCounts(number)
    }

    output.forEachIndexed { index, i ->
        if (index == output.lastIndex) print(i)
        else println(i)
    }
}

fun readInt(): Int {
    return readLine()!!.toInt()
}

fun calculateAttemptCounts(number: Int) {
    var tempNumber = number
    var attemptCounts = 0
    for (side in sides.reversedArray()) {
        val tempCount: Int = tempNumber / side

        if (tempCount == 0) continue

        attemptCounts += tempCount

        if (tempNumber % side == 0) {
            output.add(attemptCounts)
            break
        }

        tempNumber %= side
    }
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    var T = readInt()
    while(T>0) {
        var x = readInt()
        println("%d".format(x))
        T--
    }

}

import java.util.Scanner
fun main(args:Array<String>) {
    val read = Scanner(System.`in`)
       val t:Int = read.nextInt()
       for (i in 1..t)
    {
        val n:Int = read.nextInt()
          val ans = n/2 + n%2
          println("$ans")
    }

}

import java.util.*

fun main() {
    val reader = Scanner(System.`in`)
    val queries = reader.nextInt()
    println(queries)
    val output = IntArray(queries)
    for (i in 0 until queries) {
        val point = reader.nextInt()
        output[i] = getCount(point)
    }
    output.forEach {
        println(it)
    }
}

fun getCount(point: Int): Int {
    return if (point in 2..7) {
        1
    } else {
        val rem = point % 7
        if (rem == 0) {
            point / 7
        } else {
            (point / 7) + 1
        }
    }
}

fun main(){
    val roundCount = readLine()?.toIntOrNull()
    roundCount?.let {count->
        val arrayOfPoints = Array(3){
            readLine()?.toIntOrNull()
        }
        arrayOfPoints.forEach {
            it?.let {
                println(it/2)
            }
        }
    }
}

fun main(args : Array<String>){
    if (args.isNotEmpty()) {
        Array(args[0].toInt()) { i ->(args[i+1].toInt()/7)+1 }.forEach(::print)
    }
}

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = readLine()!!.toInt()
    for(x in 0..n-1){
    	val tmp = readLine()!!.toInt()
    	println(tmp)
    }

}

fun main() {
    val n = readLine()!!.toInt()
    repeat (n) {
        readLine()!!.toInt()
        println(n)
    }
}

fun main(){
    val points = readLine()!!.toInt()
    println((points/7)+1)
}

import java.io.*
import java.math.*
import java.text.*
import java.util.*
import java.util.regex.*

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    val t = scan.nextInt()
    for (i in 1..t) {
        val num = scan.nextInt()
        if( num%2==0)
        print("1\n")
        else
        print("2\n")
    }
}

fun main() {
    readLine()?.toInt()?.let { numCases ->
        for (case in 0 until numCases) {
            readLine()?.toInt()?.let { println(numRolls(it)) }
        }
    }
}

private fun numRolls(points: Int): Int {
    var numRolls = 0
    var remainingPoints = points
    for (i in 7 downTo 2) {
        var rolls = remainingPoints / i
        while (rolls > 0) {
            numRolls += rolls
            remainingPoints %= i
            rolls = remainingPoints / i
        }
    }
    return numRolls
}

fun main()
{
    val t = readLine()!!.toInt()
    for (i in 1 .. t)
    {
        println(treatTestCase())
    }
}

fun treatTestCase(): String
{
    val x = readLine()!!.trim().toInt()

    // if even, return divided by 2
    // else if its 3 return 1
    // else remove three then return divided by 2 + 1

    return when
    {
        x % 2 == 0 ->
        {
            println("Roll 2 ${x / 2} times")
            (x / 2).toString()
        }
        x == 3     ->
        {
            println("Roll 3 once")
            (1).toString()
        }
        else       ->
        {
            println("Roll 3 once and 2 ${(x - 3) / 2} times")
            ((x - 3) / 2 + 1).toString()
        }
    }
}

private fun main() {

    val t = readInt()
    val mas = mutableListOf<Int>()
    (0 until t).forEach {
        mas += readInt()
    }

    mas.forEach { num ->
        if (num == 2) {
            println(1)

        } else if (num % 2 == 0) {
            println(num / 2)
        } else {
            println((num - 1) / 2 + 1)
        }
    }
}

////////////////////////////////////////////////// STUFF ///////////////////////////////////////////////////////////////

// input

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

// algorithms

// binomial coefficients C^n_k

private fun cN2(n: Int): Int {
    if (n <= 1)
        throw IllegalArgumentException("n must be positive integer >= 2")

    return n * (n - 1) / 2
}

fun main(args: Array<String>) {
    args.forEach{
        println(it)
    }
}

fun main() {
    var t = Integer.parseInt(readLine())

    while(t > 0) {
        var res = solve(Integer.parseInt(readLine()))
        println(res)
        t--
    }

}

fun solve(n:Int):Int {
    var res = 0
    var m = n
    for(i in 7 downTo 2) {
        res += m/i
        m %= i
    }
    return res
}

fun main() {
    val t = readLine()!!.toInt()
    for (i in 1..t) {
        val x = readLine()!!.toInt()
        println (x / 2 + x % 2)
    }
}

fun main(args: Array<String>) {
   args.slice(1 until args.size).forEach{
       var number = it.toInt()
       var counter = 0
       while( number > 0 ){
           number -= 7
           counter++
       }
       println(counter)
   }
}

fun main()
{
    var n = readLine()!!.toInt()

    for (i in 1..n)
    {
        var x = readLine()!!.toInt()

        var j = 0

        while (x >= 6)
        {
            j++
            x -= 6
        }

        println(j)

    }
}

fun main()
{
    val n = readLine()!!.toInt() / 2
    println(n)
}

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    for (i in 0 until sc.nextInt()) {
        val n = sc.nextInt()
        val q = n / 2
        val p = n % 2
        println(q - p)
    }
}

fun main(args: Array<String>) {

    val diceNumbers = 7 downTo 2
    val rounds = readLine()!!.toInt()

    val queriedNumbers = (1..rounds).asSequence()
            .map { readLine() }
            .filterNotNull()
            .map { it.toInt() }
            .toList()

    for (queriedNumber in queriedNumbers)
    {
        var rolls = 0
        var remaining = queriedNumber

        for (diceNumber in diceNumbers)
        {
            val rollsWithCurrentNumber = remaining / diceNumber

            rolls += rollsWithCurrentNumber
            remaining -= rollsWithCurrentNumber * diceNumber

            if (remaining == 0)
            {
                break
            }
        }

        println(rolls)
    }
}

class DiceRolling {
    fun all(points: List<Int>): List<Int> {
        val results = mutableListOf<Int>()
        points.forEach { results.add(one(it)) }
        return results
    }

    // 2, 3, 4, 5, 6, 7
    fun one(point: Int): Int {
        return if (point <= 7) 1
        else {
            1 + one(point - 6)
        }
    }
}

fun main(args: Array<String>) {
    val points = args.drop(1).map { Integer.parseInt(it) }
    println(DiceRolling().all(points))
}

fun main() {
    val t = readLine()!!.toInt()
    for (i in 1..t) {
        val x = readLine()!!.toInt()
        println (x / 2 - x % 2)
    }
}

fun main(args: Array<String>) {
    val scanner = java.util.Scanner(System.`in`)
    var inputCount = scanner.nextLine()
    val count = inputCount.toInt()
    var inputList = ArrayList<Int>(count)

    val minBoneValue = 2
    val maxBoneValue = 7
    val minValue = 1

    for (x in minValue..count) {
        var value = scanner.nextLine()
        inputList.add(value.toInt())
    }

    for (x in inputList) {
        if(x >= minBoneValue && x <= maxBoneValue){
            println(minValue)
        }
        else {
            var throwsCount = (x/maxBoneValue)
            val remainder = x%maxBoneValue
            if(remainder > minValue)
                throwsCount++
            println(throwsCount)
        }
    }
}

fun main()
{
    val t = readLine()!!.toInt()
    for (i in 1 .. t)
    {
        println(treatTestCase())
    }
}

fun treatTestCase(): String
{
    var x = readLine()!!.toInt()

    var c = 7
    var count = 0

    while (x > 0 && c > 1)
    {
        if (x >= c)
        {
            val remainder = x % c
            count += (x - remainder) / c
            x = remainder
        }

        c--
    }

    return count.toString()
}

import java.util.*
import kotlin.collections.ArrayList
fun main() {
    val read=Scanner(System.`in`);
    var test=read.nextInt();
    while((test--)>0){
        var x=read.nextInt();
        println(x);
        var cnt=0;

        for (i in 7 downTo 2){

            if(x==0)break;
            cnt+=x/i;
            x %= i;
        }
        println(cnt);
    }
}

import java.util.*

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readLong() = readLn().toLong()
// etc for other types you'd use in your solutions
fun main(args: Array<String>){
    val t = readInt()
    for(i in 1..t){
        var x = readInt()
        var total: Int=0
        for(j in 7 downTo 2){
            total += x/j
            x = x%j
        }
        println("$total")
    }
}

import java.util.*

fun main(args: Array<String>) = with(Scanner(System.`in`)){

    val dice = arrayOf(7,6,5,4,3,2)

    val t = nextInt()
    val points = IntArray(t)
    for (count in 0 until t)
        points[count] = nextInt()

    for(point in points){
        var rolls = 0
        var tempPoint = point
        for(num in dice)
            if(num <= tempPoint)
            {
                rolls += (tempPoint/num)
                tempPoint %= num
            }
        println(rolls)
    }
}

fun main(args: Array<String>) {
    val countLine = readLine()
    println(countLine)
}

import java.io.*
import java.math.*
import java.text.*
import java.util.*
import java.util.regex.*

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    val t = scan.nextInt()
    for (i in 1..t) {
        val num = scan.nextInt()
        if( num%2==0)
        print("1\n")
        else
        print("2\n")
    }
}

fun readInts(separator: Char = ' ') = readLine()!!.split(separator).map(String::toInt)
fun main() {
    val A = readInts()
    for(i in 1..A.size-1){
        val x = A[i]/2
        println("$x")
    }
}

fun main() {
    var t = Integer.parseInt(readLine())

    while(t > 0) {
        var res = solve(Integer.parseInt(readLine()))
        println(res)
        t--
    }

}

fun solve(n:Int):Int {
    var res = 0
    var m = n
    for(i in 7 downTo 2) {
        res += m/i
        m %= i
    }
    return res
}

import kotlin.random.Random

fun main(args: Array<String>) {
   args.slice(1 until args.size).forEach{
       var number = it.toInt()
       var counter = 0
       while( number > 7 ){
           number -= Random.nextInt(2, 7)
           counter++
       }
       println(counter)
   }
}

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = readLine()!!.toInt()
    for(x in 0..n-1){
    	val tmp = readLine()!!.toInt()
    	if(tmp <= 6) println("1")
    	else{
    		println(tmp/6+tmp%6)
    	}
    }

}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    for (i in 0 until n) {
        val x = readLine()!!.toInt()
        val t = x / 2
        if (t*2 == x) {
            println(t)
        } else {
            println(t+1)
        }
    }
}


fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    val (_, s) = readInts()
    val a = readInts()
    print(if (a.sum() - a.max()!! <= s) "YES" else "NO")
}

import java.util.*

fun min(a:Double,b:Double) = if (a<b) a else b
fun max(a:Double,b:Double) = if (a>b) a else b
fun min(a:Int,b:Int) = if (a<b) a else b
fun max(a:Int,b:Int) = if (a>b) a else b
fun printD(d: Double) { print(d) }
fun printI(d:Int) { print(d) }
fun printS(d: String) { print(d) }
fun printL(d: Long) { print(d) }
fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readInts()  = readLn().split(" ").map{it.toInt()}
fun readLong() = readLn().toLong()
class pair (var first:Int, var second:Int)

fun solve() {
   val cin = Scanner(System.`in`)

   /*
   map[q] <=> map.getOrDefault(q,0)
   Сортировка вектора пар - k=v.sortedWith(compareBy({it.first},{it.second}));
   print("${k[i].second}"); - вывод аргумента пары
   var m=ArrayList<int> (); <=> vector
   getline(cin,a) <=> readLine()!!.last()

  readInt() - одно число
  readInts() - несколько чисел

   */

    /* --------- */

 var (a,b)=readInts();
 var q=readInts();
 var sum=0;
 var max1=0;
 for (i in q) {
 max1=max(max1,i); sum+=i; }
 if (b>=sum-max1) print("YES"); else print("NO");
   /* --------- */

}

    fun main() {
    val cin = Scanner(System.`in`)

    var T=1;
    //T=readLine()!!.toInt();

    for (i55555 in 1..T) solve()
}

import java.util.*

fun main(args: Array<String>) = with(Scanner(System.`in`), {
    var (n, s) = readLine()!!.split(" ").map { it.toInt() }
    var mx = 0
    var sum = 0
    for (i in 1..n) {
        sum += nextInt().apply { mx = Math.max(mx, this) }
    }
    if (sum - mx <= s) print("YES") else print("NO")
})