package net.ipipip0129.kotlin.yukicoder import kotlin.math.max fun main(args: Array) { val num = readLine()!!.toInt() val numList = readLine()!!.split(" ").map { it.toInt() } val numMap = mutableMapOf() var i = 0 var ans = 0 while (i < num) { if (numMap.containsKey(numList[i])) { ans = numMap.size i = numMap[numList[i]]!! + 1 numMap.clear() numMap[numList[i]] = i } else { numMap[numList[i]] = i } i++ } print(max(ans, numMap.size)) }