calculate letter distance of key