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