#!/usr/bin/env python3 input(), print(sum(min(abs(a - b), abs(a + 26 - b)) for a, b in zip(map(ord, input()), map(ord, input()))))