fun main(args: Array) { println(getAns()) } fun getAns():Int { val n = readLine()!! if(n.first() != '1') { return -1 } val tmp = n.drop(1) if(tmp.isEmpty()) { return -1 } if(tmp.all { it == '3' }) { return tmp.length } return -1 }