Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list
Note : You may assume that word1 does not equal to word2, and word1 and word2 are both in the list.
Input Format
First line contains input N. Next line contains N space separated String denoting the elements of the array. third line contains word1 and word2
Constraints
None
Output Format
Shortest Distance between word1 and word 2
Sample Input
5
practice makes perfect coding makes
coding practice
Sample Output
3
Explanation
5
practice makes perfect coding makes
makes coding
output : 1