fun main(){println((readLine()!!+readLine()!!).split("x").filter{it.isNotEmpty()}.map{it.toInt()}.max())}