def main():
    #wczytywanie danych
    n = int(input())
    t1 = input().strip()
    t2 = input().strip()
    #wyznaczanie wartości
    counter1, counter2 = 0, 0
    for i in range(n):
        c1 = min(counter1, 1 + counter2)
        c2 = min(counter2, 1 + counter1)
        if t1[i]=='x':
            c1 += 1
        if t2[i]=='x':
            c2 += 1
        counter1, counter2 = c1, c2
    #wypisanie odpowiedzi
    print(min(counter1, counter2))
if __name__ == '__main__': 
    main()