import kotlin.math.absoluteValue fun main() { readInt() val a = readln() val b = readln() println(a.zip(b).sumOf {(x, y) -> val d = (x.code - y.code).absoluteValue minOf(d, 26 - d) }) } private fun readInt() = readln().toInt() private fun readLongs() = readStrings().map { it.toLong() } private fun readStrings() = readln().split(" ") private fun readInts() = readStrings().map { it.toInt() }