@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.SortedMap
import java.util.StringTokenizer
import java.util.TreeMap
import kotlin.math.*
import kotlin.random.*
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending
import kotlin.io.println as iprintln

/** @author Spheniscine */
fun main() { _writer.solve(); _writer.flush() }
fun PrintWriter.solve() {
    val n = readInt()
    val K = readIntArray(n).toCollection(HashBag())
    val maxk = K.elements.max()!!

    val primes = IntList()
    val F = List(maxk + 1) { TreeBag<Int>() }

    factorize@ for(i in 2 .. maxk) {
        for(p in primes) {
            if(p * p > i) break
            if(i % p == 0) {
                F[i].addAll(F[i / p])
                F[i].add(p)
                continue@factorize
            }
        }
        primes.add(i)
        F[i].add(i)
    }

    for(i in 3 .. maxk) F[i].addAll(F[i-1])

    var ans = K.sumByLong { F[it].size.toLong() }
    var curr = K
    loop@ while(true) {
        val tails = HashMap<Int, HashBag<Int>>()
        for((i, num) in curr.entries) {
            F[i].pollLast()?.also { f -> tails.getOrPut(f) { HashBag() }.add(i, num) }
        }
        for((_, bag) in tails.entries) {
            val num = bag.size
            if(num > n/2) {
                ans -= num - (n - num)
                curr = bag
                continue@loop
            }
        }
        break
    }

    println(ans)
}

fun <T> TreeBag<T>.pollLast() = if(isEmpty()) null else last().also { remove(it) }

inline fun <T> Bag<T>.sumByLong(func: (T) -> Long) = entries.fold(0L) { acc, (k, v) ->
    acc + func(k) * v
}

interface Bag<T> : Collection<T> {
    val countMap: Map<T, Int>

    fun getCount(element: T): Int = countMap[element] ?: 0
    val elements: Set<T> get() = countMap.keys
    val entries: Set<Map.Entry<T, Int>> get() = countMap.entries

    override fun iterator(): Iterator<T> = sequence {
        for((e, cnt) in countMap) {
            repeat(cnt) { yield(e) }
        }
    }.iterator()

    override fun contains(element: T): Boolean = countMap.containsKey(element)
}

private fun Bag<*>._size() = countMap.values.sum()
private fun Bag<*>._equals(other: Any?) = when {
    this === other -> true
    other is Bag<*> -> countMap == other.countMap
    else -> false
}
private fun Bag<*>._hashCode() = countMap.hashCode()

class BagImpl<T>(override val countMap: Map<T, Int>): Bag<T>, AbstractCollection<T>() {
    override val size = _size()
    override fun equals(other: Any?) = _equals(other)
    override fun hashCode() = _hashCode()
    override fun contains(element: T) = super<Bag>.contains(element)
    override fun iterator() = super.iterator()
}
fun <T> Bag(countMap: Map<T, Int>): Bag<T> = BagImpl(countMap)

interface MutableBag<T> : Bag<T>, MutableCollection<T> {
    val _countMap: MutableMap<T, Int>
    var _size: Int

    override fun add(element: T): Boolean { add(element, 1); return true }
    fun add(element: T, occurrences: Int): Int {
        require(occurrences >= 0)
        val oldCount = getCount(element)
        _countMap[element] = oldCount + occurrences
        _size += occurrences
        return oldCount
    }

    override fun remove(element: T): Boolean = remove(element, 1) > 0
    fun remove(element: T, occurrences: Int): Int {
        require(occurrences >= 0)
        val oldCount = getCount(element)
        val m = minOf(occurrences, oldCount)
        when(oldCount) {
            0 -> return 0
            m -> _countMap.remove(element)
            else -> _countMap[element] = oldCount - m
        }
        _size -= m
        return oldCount
    }

    fun setCount(element: T, occurrences: Int): Int {
        require(occurrences >= 0)
        val oldCount = getCount(element)
        if(occurrences == 0) _countMap.remove(element)
        else _countMap[element] = occurrences
        _size += occurrences - oldCount
        return oldCount
    }

    override fun iterator(): MutableIterator<T> = object: MutableIterator<T> {
        private val mapIterator = _countMap.iterator()
        private var rem = 0
        private lateinit var lastEntry: MutableMap.MutableEntry<T, Int>
        private var removed = true
        override fun hasNext() = rem > 0 || mapIterator.hasNext()
        override fun next(): T {
            if(rem == 0) {
                lastEntry = mapIterator.next()
                rem = lastEntry.value
            }
            rem--
            removed = false
            return lastEntry.key
        }
        override fun remove() {
            if(removed) error("")
            lastEntry.setValue(lastEntry.value - 1)
            if(lastEntry.value == 0) mapIterator.remove()
            _size--
            removed = true
        }
    }
}

abstract class AbstractMutableBag<T>: MutableBag<T>, AbstractMutableCollection<T>() {
    final override val countMap: Map<T, Int> get() = _countMap
    final override val size get() = _size
    override fun equals(other: Any?) = _equals(other)
    override fun hashCode() = _hashCode()
    override fun contains(element: T) = super<MutableBag>.contains(element)
    override fun iterator() = super.iterator()
    override fun add(element: T): Boolean = super.add(element)
    override fun addAll(elements: Collection<T>): Boolean =
        if(elements is Bag<T>) {
            for((e, n) in elements.countMap) add(e, n)
            true
        } else super.addAll(elements)
    override fun remove(element: T): Boolean = super<MutableBag>.remove(element)
    override fun removeAll(elements: Collection<T>): Boolean =
        if(elements is Bag<T>) {
            var modified = false
            for((e, n) in elements.countMap) if(remove(e, n) > 0) modified = true
            modified
        } else super.removeAll(elements)
}

interface SortedBag<T>: MutableBag<T> {
    override val _countMap: SortedMap<T, Int>

    fun first(): T = _countMap.firstKey()
    fun last(): T = _countMap.lastKey()
}

class SortedBagImpl<T>(override val _countMap: SortedMap<T, Int>): SortedBag<T>, AbstractMutableBag<T>() {
    override var _size = _size()
}
fun <T> SortedBag(countMap: SortedMap<T, Int>): SortedBag<T> = SortedBagImpl(countMap)

class TreeBag<T>(override val _countMap: TreeMap<T, Int>): SortedBag<T>, AbstractMutableBag<T>() {
    constructor(): this(TreeMap())
    constructor(comparator: Comparator<in T>?): this(TreeMap(comparator))

    override var _size = _size()

    fun floor(element: T): T? = _countMap.floorKey(element)
    fun ceiling(element: T): T? = _countMap.ceilingKey(element)
    fun lower(element: T): T? = _countMap.lowerKey(element)
    fun higher(element: T): T? = _countMap.higherKey(element)
}

class HashBag<T>(override val _countMap: HashMap<T, Int>): AbstractMutableBag<T>() {
    constructor(): this(HashMap())

    override var _size = _size()
}

class IntList(initialCapacity: Int = 12) {
    private var _arr = IntArray(initialCapacity)
    private val capacity get() = _arr.size
    var size = 0
        private set
    inline val lastIndex get() = size - 1
    inline val indices get() = 0 until size

    private fun grow(minCapacity: Int = 8) {
        val newCapacity = maxOf(minCapacity, capacity + (capacity shr 1))
        _arr = _arr.copyOf(newCapacity)
    }

    fun ensureCapacity(minCapacity: Int) { if(capacity < minCapacity) grow(minCapacity) }

    operator fun get(index: Int): Int {
        require(index in 0 until size)
        return _arr[index]
    }

    operator fun set(index: Int, value: Int) {
        require(index in 0 until size)
        _arr[index] = value
    }

    fun add(value: Int) {
        if(size == capacity) grow()
        _arr[size++] = value
    }

    fun clear() { size = 0 }

    operator fun iterator() = object: IntIterator() {
        private var pos = 0
        override fun hasNext() = pos < size
        override fun nextInt() = get(pos++)
    }

    fun isEmpty() = size == 0
    fun isNotEmpty() = size != 0

    fun pop() = _arr[--size]

    fun swap(i: Int, j: Int) { this[i] = this[j].also { this[j] = this[i]} }
    fun reverse() {
        for(i in 0 until size / 2) swap(i, lastIndex - i)
    }

    fun shuffle(rnd: Random = random) = _shuffle(rnd, _arr::get, _arr::set, size)
    fun sort() { shuffle(); _arr._sort(0, size) }
    fun sortDescending() { sort(); reverse() }

    fun joinToString(separator: String) = if(size == 0) "" else let {
        buildString {
            append(it[0])
            for (i in 1 until size) {
                append(separator).append(it[i])
            }
        }
    }

    override fun toString() = "[" + joinToString(", ") + "]"
}

inline fun IntList(size: Int, init: (Int) -> Int) = IntList(size).apply {
    for(i in 0 until size) { add(init(i)) }
}

fun IntList.max() = (1 until size).fold(this[0]) { acc, i -> max(acc, this[i]) }
fun IntList.min() = (1 until size).fold(this[0]) { acc, i -> min(acc, this[i]) }

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x594E215C123 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()

fun `please stop removing these imports IntelliJ`() {
    iprintln(max(1, 2))
}


import kotlin.math.min
import kotlin.math.sign

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 arr = Array(5) { IntArray(5) }
    for (i in 1..3) {
        val s = readInts()
        for (j in 1..3) {
            arr[i][j] = s[j - 1]
        }
    }
    for (i in 1..3) {
        for (j in 1..3) {
            val sum = arr[i][j] + arr[i - 1][j] + arr[i + 1][j] + arr[i][j - 1] + arr[i][j + 1]
            print(if (sum % 2 == 0) 1 else 0)
        }
        println()
    }
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.AssertionError
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  private val reader = BufferedReader(InputStreamReader(stream), 32768)

  private val N = ni()
  fun solve() {
    for (t in 0 until N) {
      val s = ns().drop(4)
      var lst = 1988L
      var digit = 1L
      var right = 0L
      for (d in s.reversed()) {
        right += (d-'0') * digit

        var left = lst/(digit*10)

        while(left * (digit*10) + right <= lst) {
          left++
        }

        debug{"$left $right"}

        lst = left * (digit*10) + right

        debug{"$lst"}

        digit *= 10
        left /= 10
      }
      out.println(lst)
    }
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private inline fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private inline fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private inline fun debug(a: BooleanArray) {
    debug { toString(a) }
  }

  private inline fun toString(a: BooleanArray) = run{a.map { if (it) 1 else 0 }.joinToString("")}

  private inline fun debugDim(A: Array<LongArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }
  private inline fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }

  private inline fun assert(b: Boolean) = run{if (!b) throw AssertionError()}
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()

//  val out = java.io.PrintWriter(System.out)
//  val fin = java.io.FileInputStream(java.io.File("in.txt"))
//  Solver(fin, out).solve()
//  out.flush()
//  fin.close()
}


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

class InputReader(val stream: InputStream) {
    val buf = ByteArray(1024)
    var curChar: Int = 0
    var numChars: Int = 0

    fun read(): Char {
        if (numChars == -1)
            throw InputMismatchException()
        if (curChar >= numChars) {
            curChar = 0
            try {
                numChars = stream.read(buf)
            } catch (e: IOException) {
                throw InputMismatchException()
            }
            if (numChars <= 0)
                return '\uFFFF'
        }
        return buf[curChar++].toChar()
    }

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

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

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

    fun isSpaceChar(c: Char): Boolean {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == '\uFFFF'
    }
}

class OutputWriter(val stream: OutputStream) {
    val buf = ByteArray(65536)
    var curPos: Int = 0

    fun write(c: Char) {
        if (buf.size - curPos < 1) flush()
        buf[curPos++] = c.toByte()
    }

    fun write(s: String) {
        if (buf.size - curPos < s.length) flush()
        var idx = 0
        if (s.length > buf.size) {
            var remaining = s.length
            while (remaining > buf.size) {
                while (curPos < buf.size) buf[curPos++] = s[idx++].toByte()
                flush()
                remaining -= buf.size
            }
        }
        while (idx < s.length) buf[curPos++] = s[idx++].toByte()
    }

    fun flush() {
        stream.write(buf, 0, curPos)
        curPos = 0
    }
}

inline fun <T> ArrayList<T>.swap(ia: Int, ib: Int) {
    val tmp = this[ia]
    this[ia] = this[ib]
    this[ib] = tmp
}

inline fun ArrayList<Char>.toStr(): String {
    val builder = StringBuilder(this.size)
    for (c in this) {
        builder.append(c)
    }
    return builder.toString()
}

fun main(args: Array<String>) {
    if (args.isNotEmpty()) System.setIn(FileInputStream(args[0]))
    val ir = InputReader(System.`in`)
    val ow = OutputWriter(System.out)

    val lst = mutableListOf<Long>()
    for (i in 2 .. 10 step 2) {
        val ca = ArrayList<Char>()
        for (j in 1 .. i / 2) {
            ca.add('4')
        }
        for (j in 1 .. i / 2) {
            ca.add('7')
        }
        while (true) {
            lst.add(ca.toStr().toLong())
            var swapped = false
            for (j in ca.size - 2 downTo 0) {
                if (ca[j] == '4' && ca[j + 1] == '7') {
                    ca.swap(j, j + 1)
                    swapped = true
                    ca.subList(j + 1, ca.size).sort()
                    break
                }
            }
            if (!swapped) break
        }
    }

    val n = ir.nextInt()
    var lo = 0; var hi = lst.lastIndex
    while (lo <= hi) {
        val mid = (lo + hi) ushr 1
        if (n <= lst[mid]) hi = mid - 1  // <= to < for lower-bound to upper-bound
        else lo = mid + 1
    }
    val answer = lo

    ow.write("${lst[answer]}\n")
    ow.flush()
}


import java.io.*
import kotlin.concurrent.thread
import java.io.IOException
import java.io.BufferedReader
import java.io.InputStream
import kotlin.*
import java.*
import java.io.OutputStream
import java.io.PrintWriter
import java.lang.ArithmeticException
import java.lang.Exception
import java.math.BigInteger
import java.security.cert.TrustAnchor
import java.util.*
import kotlin.collections.ArrayList
import kotlin.system.exitProcess

fun main() {
    val inputStream = System.`in`
    val outputStream = System.out
    val `in` = InputReader(inputStream)
    val out = PrintWriter(outputStream)

    val n = `in`.nextLong()+2
    var t = `in`.nextLong()

    if (t and t - 1 > 0) {
        out.println(0)
    } else {
        var kol = 1
        var ans=0L
        if (t==1L)
            --ans
        while (t % 2 == 0L) {
            ++kol
            t /= 2
        }

        fun C(b:Int,m:Int):Long {
            if (b<m)
                return 0
            if (m<0)
                return 0
            var x = BigInteger.ONE
            for (i in 1..b)
                x=x.multiply(BigInteger(i.toString()))
            for (i in 1..m)
                x=x.divide(BigInteger(i.toString()))
            for (i in 1..b-m)
                x=x.divide(BigInteger(i.toString()))
            return x.toLong()
        }

        for (i in 60 downTo 0)
        {
            if ((1L shl i).and(n)>0) {
                ans += C(i, kol)
                --kol
            }
        }

        out.println(ans)
    }

    out.close()

}

internal 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 next().toLong()
    }

}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val N = ni()
    val A = ni() - 1
    val B = ni() - 1
    val K = ni()
    val dp = Array(K + 1){LongArray(N + 10)}
    dp[0][A] = 1
    for (i in 1 .. K) {
      for (j in 0 until N) {
        val d = abs(B - j) - 1
        val t = min(N - 1, j + d)
        val b = max(0, j - d)
        val v = dp[i - 1][j]
        dp[i][b] = (dp[i][b] + v) % MOD
        dp[i][j] = (MOD + dp[i][j] - v) % MOD
        if (j + 1 <= t + 1) {
          dp[i][j + 1] = (dp[i][j + 1] + v) % MOD
          dp[i][t + 1] = (MOD + dp[i][t + 1] - v) % MOD
        }
      }
      for (j in 1 until N) {
        dp[i][j] = (dp[i][j] + dp[i][j - 1]) % MOD
      }
      debug(dp[i])
    }
    out.println(dp[K].take(N).sum() % MOD)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}