import java.util.Scanner;

public class Equalize1 {

	public static void main(String[] args) {

		Scanner sc = new Scanner (System.in) ;

		int length = Integer.parseInt(sc.nextLine()) ;

//        char[] a = sc.next().toCharArray();
		String s1 = sc.nextLine() ;
		String s2 = sc.nextLine() ;
		int count = 0 ;

		boolean flag = false ;

		for(int i = 0 ; i < length ; i ++)
		{
			if(s1.charAt(i) != s2.charAt(i))
			{
				if(!flag)
				{
					if(i < length-1)
					{
						if((s1.charAt(i+1) != s2.charAt(i+1)) && (s1.charAt(i) != s1.charAt(i+1)))
						{
							count -- ;
							flag = true ;
						}
					}
				}
				else
					flag = false ;
				count ++ ;
			}
		}
		System.out.println(count) ;

	}

}


import java.util.Scanner;

public class Equalize {

	public static void main(String[] args) {

		Scanner sc = new Scanner (System.in) ;

		int length = Integer.parseInt(sc.nextLine()) ;

		String s1 = sc.nextLine() ;
		String s2 = sc.nextLine() ;
		int count = 0 ;

		for(int i = 0 ; i < length ; i++)
		{
			if(s1.charAt(i) != s2.charAt(i))
			{
				boolean changed = false ;
				for(int j = i + 2 ; j > i ; j --)
				{
					if(s1.charAt(j) != s2.charAt(j))
					{
						if(j - i == 1 || j - i == 2)
						{
							String s = "" ;
							for(int k = 0 ; k < length ; k++)
							{
								if(k == i)
									s += s2.charAt(i) ;
								else
									if(k == j)
										s += s2.charAt(j) ;
									else
										s += s1.charAt(k) ;
							}
							s1 = s ;
							count += j - i ;
							changed = true ;
						}
					}
				}
				if(!changed)
					count += 1 ;
			}

		}

		System.out.println(count) ;

	}

}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
import java.lang.*;

public class GFG {
	public static void main (String[] args) {
		//System.out.println("GfG!");

		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String a=sc.next();
		String b=sc.next();
		int ctr=0;
		for(int i=0;i<a.length();i++)
		{
		    if(a.charAt(i)!=b.charAt(i))
		    {
		        ctr++;
		    }
		}
		//System.out.println(ctr);
		for(int i=0;i<a.length()-1;i++)
		{
		    if(a.charAt(i)!=b.charAt(i) && a.charAt(i+1)!=b.charAt(i+1) && a.charAt(i)!=a.charAt(i+1))
		    {
		        ctr--;
		        i++;
		    }
		}
		System.out.println(ctr);
	}
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
import java.lang.*;

public class GFG {
	public static void main (String[] args) {
		//System.out.println("GfG!");

		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String a=sc.next();
		String b=sc.next();
		int ctr=0;
		for(int i=0;i<a.length();i++)
		{
		    if(a.charAt(i)!=b.charAt(i))
		    {
		        ctr++;
		    }
		}
		//System.out.println(ctr);
		for(int i=0;i<a.length()-1;i++)
		{
		    if(a.charAt(i)==b.charAt(i+1) && a.charAt(i+1)==b.charAt(i))
		    {
		        ctr--;
		        i++;
		    }
		}
		System.out.println(ctr);
	}
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
import java.lang.*;

public class GFG {
	public static void main (String[] args) {
		//System.out.println("GfG!");

		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String a=sc.next();
		String b=sc.next();
		int ctr=0;
		for(int i=0;i<a.length();i++)
		{
		    if(a.charAt(i)!=b.charAt(i))
		    {
		        ctr++;
		    }
		}
		//System.out.println(ctr);
		for(int i=0;i<a.length()-1;i++)
		{
		    if(a.charAt(i)!=b.charAt(i) && a.charAt(i+1)!=b.charAt(i) && a.charAt(i)!=b.charAt(i+1))
		    {
		        ctr--;
		        i++;
		    }
		}
		System.out.println(ctr);
	}
}


import java.io.*;

public class Test {

    static int readInt() {
        int ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static long readLong() {
        long ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static String readLine() {
        StringBuilder b = new StringBuilder();
        try {
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '\n') {
                    break;
                } else {
                    b.append((char) (c));
                }
            }
        } catch (IOException e) {
        }
        return b.toString().trim();
    }

    static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    void start() {
        int n = readInt();
        char[] a = readLine().toCharArray(), b = readLine().toCharArray();
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (a[i] != b[i]) {
                if (i + 1 < n && a[i] == b[i+1] && b[i] == a[i+1]) {
                    ans++;
                    i++;
                } else ans++;
            }
        writer.println(ans);
    }

    public static void main(String[] args) {
        Test te = new Test();
        te.start();
        writer.flush();
    }
}


import java.io.*;

public class Test {

    static int readInt() {
        int ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static long readLong() {
        long ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static String readString() {
        StringBuilder b = new StringBuilder();
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c >= '0' && c <= '9') {
                    start = true;
                    b.append((char) (c));
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return b.toString().trim();
    }

    static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    void start() {
        int n = readInt();
        char[] a = readString().toCharArray(), b = readString().toCharArray();
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (a[i] != b[i]) {
                if (i + 1 < n && a[i] == b[i+1] && b[i] == a[i+1]) {
                    ans++;
                    i++;
                } else ans++;
            }
        writer.println(ans);
    }

    public static void main(String[] args) {
        Test te = new Test();
        te.start();
        writer.flush();
    }
}


import java.io.*;
import java.util.*;

public class Test {

    static int readInt() {
        int ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static long readLong() {
        long ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static String readString() {
        StringBuilder b = new StringBuilder();
        try {
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c < '0' || c > '9') {
                    break;
                } else {
                    b.append((char) (c));
                }
            }
        } catch (IOException e) {
        }
        return b.toString().trim();
    }

    static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    void start() {
        int n = readInt();
        char[] a = readString().toCharArray(), b = readString().toCharArray();
        int ans = 0;
        for (int i = 0; i < n; i++)
            if (a[i] != b[i]) {
                if (i + 1 < n && a[i] == b[i+1] && b[i] == a[i+1]) {
                    ans++;
                    i++;
                } else ans++;
            }
        writer.println(ans);
    }

    public static void main(String[] args) {
        Test te = new Test();
        te.start();
        writer.flush();
    }
}


import java.io.*;
import java.util.*;

public class Test {

    static int readInt() {
        int ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static long readLong() {
        long ans = 0;
        boolean neg = false;
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c == '-') {
                    start = true;
                    neg = true;
                    continue;
                } else if (c >= '0' && c <= '9') {
                    start = true;
                    ans = ans * 10 + c - '0';
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return neg ? -ans : ans;
    }

    static String readString() {
        StringBuilder b = new StringBuilder();
        try {
            boolean start = false;
            for (int c = 0; (c = System.in.read()) != -1; ) {
                if (c >= '0' && c <= '9') {
                    start = true;
                    b.append((char) (c));
                } else if (start) break;
            }
        } catch (IOException e) {
        }
        return b.toString().trim();
    }

    static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    void start() {
        int n = readInt();
        char[] a = readString().toCharArray(), b = readString().toCharArray();
        int[] dp = new int[n+1];
        for (int i = 1; i <= n; i++) {
            dp[i] = dp[i - 1] + (a[i-1] == b[i-1] ? 0 : 1);
            if (i >= 2 && a[i-1] == b[i-2] && a[i-2] == b[i-1])
                dp[i] = Math.min(dp[i], dp[i-2] + 1);
        }
        writer.println(dp[n]);
    }

    public static void main(String[] args) {
        Test te = new Test();
        te.start();
        writer.flush();
    }
}


package code_forces.Div2C.Level1300;
import java.util.*;
import java.io.*;
public class Equalize {

	static long mod=(long)(1e9+7);
	public static void main(String[] args) throws java.lang.Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		char[] a=br.readLine().toCharArray(),b=br.readLine().toCharArray();
		int i=0,ans=0;
		while(i<n) {
			if(a[i]!=b[i]) {
				++ans;
//	    we will swap value between 2 indexes only when those indexex are adjacent
//		to each other and both have different values.
				if(i+1<n && a[i+1]!=b[i+1] && a[i]!=a[i+1]) i+=2;
				else ++i;
				continue;
			}
			++i;
		}
		System.out.println(ans);

	}
	static class CP {

		static long binary_Expo(long a, long b) { // calculating a^b
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res *= a;
					--b;
				}
				a *= a;
				b /= 2;
			}
			return res;
		}

		static long Modular_Expo(long a, long b) {
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res = (res * a) % mod;
					--b;
				}
				a = (a * a) % mod;
				b /= 2;
			}
			return res;
		}

		static long gcd(long a, long b) {// here b is the remainder
			if (b == 0)
				return a; //because each time b will divide a.
			return gcd(b, a % b);
		}

		static long ceil_div(long a, long b) { // a numerator b denominator
			return (a + b - 1) / b;
		}

		static int getIthBitFromInt(int bits, int i) {
			return (bits >> (i - 1)) & 1;
		}

		static int upper_Bound(int a[], int x) {//closest to the left+1
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] <= x)
					l = m;
				else
					r = m;
			}
			return l + 1;
		}

		static int lower_Bound(int a[], int x) {//closest to the right
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] >= x)
					r = m;
				else
					l = m;
			}
			return r;
		}

		static void sort(int a[]) {
			PriorityQueue<Integer> q = new PriorityQueue<>();
			for (int i = 0; i < a.length; i++)
				q.add(a[i]);
			for (int i = 0; i < a.length; i++)
				a[i] = q.poll();
		}

	}
}


import java.util.*;
import java.io.*;
public class Equalize {

	static long mod=(long)(1e9+7);
	public static void main(String[] args) throws java.lang.Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		char[] a=br.readLine().toCharArray(),b=br.readLine().toCharArray();
		int i=0,ans=0;
		while(i<n) {
			if(a[i]!=b[i]) {
				++ans;
//	    we will swap value between 2 indexes only when those indexes are adjacent
//		to each other and both have different values.
				if(i+1<n && a[i+1]!=b[i+1] && a[i]!=a[i+1]) i+=2;
				else ++i;
			}
			++i;
		}
		System.out.println(ans);

	}
	static class CP {

		static long binary_Expo(long a, long b) { // calculating a^b
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res *= a;
					--b;
				}
				a *= a;
				b /= 2;
			}
			return res;
		}

		static long Modular_Expo(long a, long b) {
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res = (res * a) % mod;
					--b;
				}
				a = (a * a) % mod;
				b /= 2;
			}
			return res;
		}

		static long gcd(long a, long b) {// here b is the remainder
			if (b == 0)
				return a; //because each time b will divide a.
			return gcd(b, a % b);
		}

		static long ceil_div(long a, long b) { // a numerator b denominator
			return (a + b - 1) / b;
		}

		static int getIthBitFromInt(int bits, int i) {
			return (bits >> (i - 1)) & 1;
		}

		static int upper_Bound(int a[], int x) {//closest to the left+1
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] <= x)
					l = m;
				else
					r = m;
			}
			return l + 1;
		}

		static int lower_Bound(int a[], int x) {//closest to the right
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] >= x)
					r = m;
				else
					l = m;
			}
			return r;
		}

		static void sort(int a[]) {
			PriorityQueue<Integer> q = new PriorityQueue<>();
			for (int i = 0; i < a.length; i++)
				q.add(a[i]);
			for (int i = 0; i < a.length; i++)
				a[i] = q.poll();
		}

	}
}


import java.util.*;
import java.io.*;
public class Equalize {

	static long mod=(long)(1e9+7);
	public static void main(String[] args) throws java.lang.Exception{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
		char[] a=br.readLine().toCharArray(),b=br.readLine().toCharArray();
		int i=0,ans=0;
		while(i<n) {
			if(a[i]!=b[i]) {
				++ans;
//	    we will swap value between 2 indexes only when those indexex are adjacent
//		to each other and both have different values.
				if(i+1<n && a[i+1]!=b[i+1] && a[i]!=a[i+1]) i+=2;
				else ++i;
				continue;
			}
			++i;
		}
		System.out.println(ans);

	}
	static class CP {

		static long binary_Expo(long a, long b) { // calculating a^b
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res *= a;
					--b;
				}
				a *= a;
				b /= 2;
			}
			return res;
		}

		static long Modular_Expo(long a, long b) {
			long res = 1;
			while (b != 0) {
				if ((b & 1) == 1) {
					res = (res * a) % mod;
					--b;
				}
				a = (a * a) % mod;
				b /= 2;
			}
			return res;
		}

		static long gcd(long a, long b) {// here b is the remainder
			if (b == 0)
				return a; //because each time b will divide a.
			return gcd(b, a % b);
		}

		static long ceil_div(long a, long b) { // a numerator b denominator
			return (a + b - 1) / b;
		}

		static int getIthBitFromInt(int bits, int i) {
			return (bits >> (i - 1)) & 1;
		}

		static int upper_Bound(int a[], int x) {//closest to the left+1
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] <= x)
					l = m;
				else
					r = m;
			}
			return l + 1;
		}

		static int lower_Bound(int a[], int x) {//closest to the right
			int l = -1, r = a.length;
			while (l + 1 < r) {
				int m = (l + r) >>> 1;
				if (a[m] >= x)
					r = m;
				else
					l = m;
			}
			return r;
		}

		static void sort(int a[]) {
			PriorityQueue<Integer> q = new PriorityQueue<>();
			for (int i = 0; i < a.length; i++)
				q.add(a[i]);
			for (int i = 0; i < a.length; i++)
				a[i] = q.poll();
		}

	}
}


import java.util.*;
import java.io.*;

public class Solution {

	static class FastScanner implements Closeable {
	    BufferedReader in;
	    StringTokenizer st;
	    FastScanner() throws IOException {
	        in = new BufferedReader(new InputStreamReader(System.in));
	    }
	    String next() throws IOException {
	        while (st == null || !st.hasMoreTokens()) {
	            String line = in.readLine();
	            if (line == null) {
	            	return null;
	            }
	            st = new StringTokenizer(line);
	        }
	        return st.nextToken();
	    }
	    int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    public void close() throws IOException {
	        in.close();
	        st = null;
	    }
	}

	public static long find(int index, int n, int s, int[] arr){
		long soln = 0L;
		if(index > n / 2){
				for(int i = n / 2; i < index; i++){
					soln += (long)(s - arr[i]);
				}
			}
		else{
			for(int i = index+1; i <= n/2; i++){
				soln += (long)(arr[i] - s);
			}
		}

		return soln;
	}

	public static void main(String[] args) throws IOException{

		try(FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out)){

			int n = sc.nextInt();
			StringBuilder a = new StringBuilder(sc.next());
			StringBuilder b = new StringBuilder(sc.next());
			int ans = 0;
			for(int i = 0; i < n-1; i++){
				if(a.charAt(i) != b.charAt(i)){
					if(a.charAt(i+1) == b.charAt(i) && a.charAt(i+1) != b.charAt(i+1)){
						char c = a.charAt(i);
						a.setCharAt(i+1, c);
					}
					ans++;
				}
			}

			ans += a.charAt(n-1)==b.charAt(n-1)?0:1;

			out.println(ans);
		}

	}
}


import java.util.*;
import java.io.*;

public class Solution {

	static class FastScanner implements Closeable {
	    BufferedReader in;
	    StringTokenizer st;
	    FastScanner() throws IOException {
	        in = new BufferedReader(new InputStreamReader(System.in));
	    }
	    String next() throws IOException {
	        while (st == null || !st.hasMoreTokens()) {
	            String line = in.readLine();
	            if (line == null) {
	            	return null;
	            }
	            st = new StringTokenizer(line);
	        }
	        return st.nextToken();
	    }
	    int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    public void close() throws IOException {
	        in.close();
	        st = null;
	    }
	}

	public static long find(int index, int n, int s, int[] arr){
		long soln = 0L;
		if(index > n / 2){
				for(int i = n / 2; i < index; i++){
					soln += (long)(s - arr[i]);
				}
			}
		else{
			for(int i = index+1; i <= n/2; i++){
				soln += (long)(arr[i] - s);
			}
		}

		return soln;
	}

	public static void main(String[] args) throws IOException{

		try(FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out)){

			int n = sc.nextInt();
			StringBuilder a = new StringBuilder(sc.next());
			StringBuilder b = new StringBuilder(sc.next());
			int ans = 0;
			for(int i = 0; i < n-1; i++){
				if(a.charAt(i) != b.charAt(i)){
					if(a.charAt(i+1) == b.charAt(i)){
						char c = a.charAt(i);
						a.setCharAt(i+1, c);
					}
					ans++;
				}
			}

			out.println(ans);
		}

	}
}


import java.util.*;
import java.io.*;

public class Solution {

	static class FastScanner implements Closeable {
	    BufferedReader in;
	    StringTokenizer st;
	    FastScanner() throws IOException {
	        in = new BufferedReader(new InputStreamReader(System.in));
	    }
	    String next() throws IOException {
	        while (st == null || !st.hasMoreTokens()) {
	            String line = in.readLine();
	            if (line == null) {
	            	return null;
	            }
	            st = new StringTokenizer(line);
	        }
	        return st.nextToken();
	    }
	    int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    public void close() throws IOException {
	        in.close();
	        st = null;
	    }
	}

	public static long find(int index, int n, int s, int[] arr){
		long soln = 0L;
		if(index > n / 2){
				for(int i = n / 2; i < index; i++){
					soln += (long)(s - arr[i]);
				}
			}
		else{
			for(int i = index+1; i <= n/2; i++){
				soln += (long)(arr[i] - s);
			}
		}

		return soln;
	}

	public static void main(String[] args) throws IOException{

		try(FastScanner sc = new FastScanner();
			PrintWriter out = new PrintWriter(System.out)){

			int n = sc.nextInt();
			int s = sc.nextInt();

			int[] arr = new int[n];
			for(int i = 0; i < n; i++)
				arr[i] = sc.nextInt();

			Arrays.sort(arr);

			if(arr[n/2] == s){
				out.println("0");
				return;
			}

			int index = Arrays.binarySearch(arr, s);
			long soln = 0L;
			if(index < 0){
				if(index == -1){
					soln += (long)(arr[0] - s);
					arr[0] = s;
					index = 0;
				}

				else if(Math.abs(index) > n){
					soln += (long)(s - arr[n-1]);
					arr[n-1] = s;
					index = n-1;
				}

				else{
					index = Math.abs(index) - 1;
					long a1 = (long)(arr[index] - s);
					long a2 = (long)(s - arr[index - 1]);
					long b1 = find(index, n, s, arr);
					long b2 = find(index-1, n, s, arr);
					soln = Math.min(a1+b1, a2+b2);

				}
			}

			out.println(soln);

		}

	}
}


import java.util.*;
public class xc
{
	public static void main(String[] args)
	{
Scanner ob=new Scanner(System.in);
int n=ob.nextInt();
String a=ob.next();
String b=ob.next();int i,k=0,g=0;
	for(i=0;i<n;i++)
	{
		if(a.charAt(i)!=b.charAt(i))
		{
			g++;
		}
	}
	for(i=0;i<n-1;i++)
	{
		if(a.charAt(i)==b.charAt(i+1)&&a.charAt(i+1)==b.charAt(i))
		{
          i=i+1;
          k++;
		}
	}
	g=g-k;
	System.out.println(g);
}}


import java.util.*;
public class xc
{
	public static void main(String[] args)
	{
Scanner ob=new Scanner(System.in);
int n=ob.nextInt();
String a=ob.next();
String b=ob.next();int i,k=0,g=0;int j;
	for(i=0;i<n;i++)
	{
		if(a.charAt(i)!=b.charAt(i))
		{
			g++;
		}
	}System.out.println(g);
	for(j=0,i=0;i<n-1&&j<n-1;i++)
	{
		if(a.charAt(j)==b.charAt(j)&&a.charAt(j+1)==b.charAt(j))
		{
          j=j+2;
          k++;
		}
	else
	{
		j=j+1;
	}
	}
	g=g-k;
	System.out.println(g);
}}


import java.util.*;
public class xc
{
	public static void main(String[] args)
	{
Scanner ob=new Scanner(System.in);
int n=ob.nextInt();
String a=ob.next();
String b=ob.next();int i,k=0,g=0;
	for(i=0;i<n;i++)
	{
		if(a.charAt(i)!=b.charAt(i))
		{
			g++;
		}
	}
	for(i=1;i<n;i=i+1)
	{if(a.charAt(i)!=a.charAt(i-1)){
		if(a.charAt(i)==b.charAt(i-1)&&a.charAt(i-1)==b.charAt(i))
		{
          i=i+1;
          k=k+1;
		}}
	}
	g=g-k;
	System.out.println(g);
}}


import java.util.*;
public class xc
{
	public static void main(String[] args)
	{
Scanner ob=new Scanner(System.in);
int n=ob.nextInt();
String a=ob.next();
String b=ob.next();int i,k=0,g=0;int j;
	for(i=0;i<n;i++)
	{
		if(a.charAt(i)!=b.charAt(i))
		{
			g++;
		}
	}
	for(j=0,i=0;i<n-1&&j<n-1;i++)
	{
		if(a.charAt(j)==b.charAt(j)&&a.charAt(j+1)==b.charAt(j))
		{
          j=j+2;
          k++;
		}
	else
	{
		j=j+1;
	}
	}
	g=g-k;
	System.out.println(g);
}}


import java.util.*;
import java.io.*;

public class D6{

	public static void main(String[] args) throws IOException{

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		int n=Integer.parseInt(br.readLine());
		String a =br.readLine();
		String b=br.readLine();
		char x='a';
		char y='b';
		char p='a';
		char q='b';
		int cost=0;
		for (int i=0;i<n ;i++ ) {
			//System.out.print(i);
			x=a.charAt(i);
			y=b.charAt(i);
			if(x!=y&&i<n-1){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						x=a.charAt(i+2);
						y=b.charAt(i+2);
						if(x==q&&y==p)
							{cost+=2;
							i+=2;}
						else{
							cost+=2;
							i+=1;

						}
					}

				}else{
					cost+=1;
				}
			}else if(x!=y&&i==n-1){
				cost+=1;
			}else if(x!=y&&i==n-2){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						cost+=2;
						i+=1;
					}
				}
			}
			//System.out.println("-> "+i+" ="+cost);
		}

	System.out.println(cost);

	}

}


import java.util.*;
import java.io.*;

public class D6{

	public static void main(String[] args) throws IOException{

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		int n=Integer.parseInt(br.readLine());
		String a =br.readLine();
		String b=br.readLine();
		char x='a';
		char y='b';
		char p='a';
		char q='b';
		int cost=0;
		for (int i=0;i<n ;i++ ) {
			x=a.charAt(i);
			y=b.charAt(i);
			if(x!=y&&i!=n-1){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;

					}else{
						cost+=2;
					}
					i+=1;
				}else{
					cost+=1;
				}
			}else if(x!=y&&i==n-1){
				cost+=1;
			}
		}

	System.out.println(cost);

	}

}


import java.util.*;
import java.io.*;

public class D6{

	public static void main(String[] args) throws IOException{

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		int n=Integer.parseInt(br.readLine());
		String a =br.readLine();
		String b=br.readLine();
		char x='a';
		char y='b';
		char p='a';
		char q='b';
		int cost=0;
		for (int i=0;i<n ;i++ ) {
			//System.out.print(i);
			x=a.charAt(i);
			y=b.charAt(i);
			if(x!=y&&i<n-2){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						x=a.charAt(i+2);
						y=b.charAt(i+2);
						if(x==q&&y==p)
							{cost+=2;
							i+=2;}
						else{
							cost+=2;
							i+=1;

						}
					}

				}else{
					cost+=1;
				}
			}else if(x!=y&&i==n-1){
				cost+=1;
			}else if(x!=y&&i==n-2){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						cost+=2;
						i+=1;
					}
				}
			}
			//System.out.println("-> "+i+" ="+cost);
		}

	System.out.println(cost);

	}

}


import java.util.*;
import java.io.*;

public class D6{

	public static void main(String[] args) throws IOException{

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		int n=Integer.parseInt(br.readLine());
		String a =br.readLine();
		String b=br.readLine();
		char x='a';
		char y='b';
		char p='a';
		char q='b';
		int cost=0;
		for (int i=0;i<n ;i++ ) {
			//System.out.print(i);
			x=a.charAt(i);
			y=b.charAt(i);
			if(x!=y&&i<n-2){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						x=a.charAt(i+2);
						y=b.charAt(i+2);
						if(x==q&&y==p)
							{cost+=2;
							i+=2;}
						else{
							cost+=2;
							i+=1;

						}
					}

				}else{
					cost+=1;
				}
			}else if(x!=y&&i==n-1){
				cost+=1;
			}else if(x!=y&&i==n-2){
				p=a.charAt(i+1);
				q=b.charAt(i+1);
				if(p!=q){
					if(p==y){
						cost+=1;
						i+=1;
					}else{
						cost+=2;
						i+=1;
					}
				}else{
					cost+=1;
				}
			}
			//System.out.println("-> "+i+" ="+cost);
		}

	System.out.println(cost);

	}

}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int len = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            TreeMap<Integer, Integer> zeroError = new TreeMap<>();
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '0') {
                    zeroError.put(i, 1);
                }
            }
            int ans = 0;
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '1') {
                    Integer closestBig = zeroError.ceilingKey(i);
                    Integer closestSmall = zeroError.floorKey(i);
                    if (closestBig != null && closestSmall != null) {
                        if (Math.abs(closestBig - i) <= Math.abs(closestSmall - i)) {
                            if (Math.abs(closestBig - i) <= 2) {
                                ans += Math.abs(closestBig - i);
                                zeroError.remove(closestBig);
                            }
                            else {
                                ans++;
                            }
                        }
                        else {
                            if (Math.abs(closestSmall - i) <= 2) {
                                ans += Math.abs(closestSmall - i);
                                zeroError.remove(closestSmall);
                            }
                            else {
                                ans++;
                            }
                        }
                    }
                    else if (closestBig != null) {
                        if (Math.abs(closestBig - i) <= 2) {
                            ans += Math.abs(closestBig - i);
                            zeroError.remove(closestBig);
                        }
                        else {
                            ans++;
                        }
                    }
                    else if (closestSmall != null) {
                        if (Math.abs(closestSmall - i) <= 2) {
                            ans += Math.abs(closestSmall - i);
                            zeroError.remove(closestSmall);
                        }
                        else {
                            ans++;
                        }
                    }
                    else {
                        ans++;
                    }
                }
            }
            for (int key : zeroError.keySet()) {
                ans++;
            }
            out.write(Integer.toString(ans));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int len = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            TreeMap<Integer, Integer> zeroError = new TreeMap<>();
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '0') {
                    zeroError.put(i, 1);
                }
            }
            int ans = 0;
            Queue<IndexVal> pq = new PriorityQueue<IndexVal>(1000000, new Comparator<IndexVal>() {
                @Override
                public int compare(IndexVal o1, IndexVal o2) {
                    return Integer.compare(o1.val, o2.val);
                }
            });
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '1') {
                    Integer closestBig = zeroError.ceilingKey(i);
                    Integer closestSmall = zeroError.floorKey(i);
                    int val = Integer.MAX_VALUE;
                    if (closestBig != null && closestSmall != null) {
                        val = Math.min(val, Math.abs(closestBig - i));
                        val = Math.min(val, Math.abs(closestSmall - i));
                    }
                    else if(closestBig != null) {
                        val = Math.min(val, Math.abs(closestBig - i));
                    }
                    else if(closestSmall != null) {
                        val = Math.min(val, Math.abs(closestSmall - i));
                    }
                    pq.add(new IndexVal(i, val));
                }
            }
            while(!pq.isEmpty()) {
                IndexVal iv = pq.poll();
                int i = iv.index;
                Integer closestBig = zeroError.ceilingKey(i);
                Integer closestSmall = zeroError.floorKey(i);
                if (closestBig != null && closestSmall != null) {
                    if (Math.abs(closestBig - i) <= Math.abs(closestSmall - i)) {
                        if (Math.abs(closestBig - i) <= 2) {
                            ans += Math.abs(closestBig - i);
                            zeroError.remove(closestBig);
                        }
                        else {
                            ans++;
                        }
                    }
                    else {
                        if (Math.abs(closestSmall - i) <= 2) {
                            ans += Math.abs(closestSmall - i);
                            zeroError.remove(closestSmall);
                        }
                        else {
                            ans++;
                        }
                    }
                }
                else if (closestBig != null) {
                    if (Math.abs(closestBig - i) <= 2) {
                        ans += Math.abs(closestBig - i);
                        zeroError.remove(closestBig);
                    }
                    else {
                        ans++;
                    }
                }
                else if (closestSmall != null) {
                    if (Math.abs(closestSmall - i) <= 2) {
                        ans += Math.abs(closestSmall - i);
                        zeroError.remove(closestSmall);
                    }
                    else {
                        ans++;
                    }
                }
                else {
                    ans++;
                }
            }
            for (int key : zeroError.keySet()) {
                ans++;
            }
            out.write(Integer.toString(ans));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static class IndexVal {
        int index, val;

        public IndexVal(int index, int val) {
            this.index = index;
            this.val = val;
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int n = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            int ans[] = new int[n];
            Arrays.fill(ans, Integer.MAX_VALUE);
            if (a[0] == b[0]) {
                ans[0] = 0;
            }
            else {
                ans[0] = 1;
            }
            for (int i = 1; i < n; i++) {
                if (a[i] == b[i]) {
                    ans[i] = ans[i - 1];
                }
                else {
                    if (a[i - 1] != b[i - 1] && a[i] != a[i - 1]) {
                        ans[i] = Math.min(ans[i], (i - 2 >= 0 ? ans[i - 2] : 0) + 1);
                    }
                    else {
                        ans[i] = ans[i - 1] + 1;
                    }
                }
            }
            out.write(Integer.toString(ans[n - 1]));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static class IndexVal {
        int index, val;

        public IndexVal(int index, int val) {
            this.index = index;
            this.val = val;
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int len = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            TreeMap<Integer, Integer> zeroError = new TreeMap<>();
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '0') {
                    zeroError.put(i, 1);
                }
            }
            int ans = 0;
            Queue<IndexVal> pq = new PriorityQueue<IndexVal>(1000000, new Comparator<IndexVal>() {
                @Override
                public int compare(IndexVal o1, IndexVal o2) {
                    return -Integer.compare(o1.val, o2.val);
                }
            });
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '1') {
                    Integer closestBig = zeroError.ceilingKey(i);
                    Integer closestSmall = zeroError.floorKey(i);
                    int val = Integer.MAX_VALUE;
                    if (closestBig != null && closestSmall != null) {
                        val = Math.min(val, Math.abs(closestBig - i));
                        val = Math.min(val, Math.abs(closestSmall - i));
                    }
                    else if(closestBig != null) {
                        val = Math.min(val, Math.abs(closestBig - i));
                    }
                    else if(closestSmall != null) {
                        val = Math.min(val, Math.abs(closestSmall - i));
                    }
                    pq.add(new IndexVal(i, val));
                }
            }
            while(!pq.isEmpty()) {
                IndexVal iv = pq.poll();
                int i = iv.index;
                Integer closestBig = zeroError.ceilingKey(i);
                Integer closestSmall = zeroError.floorKey(i);
                if (closestBig != null && closestSmall != null) {
                    if (Math.abs(closestBig - i) <= Math.abs(closestSmall - i)) {
                        if (Math.abs(closestBig - i) <= 2) {
                            ans += Math.abs(closestBig - i);
                            zeroError.remove(closestBig);
                        }
                        else {
                            ans++;
                        }
                    }
                    else {
                        if (Math.abs(closestSmall - i) <= 2) {
                            ans += Math.abs(closestSmall - i);
                            zeroError.remove(closestSmall);
                        }
                        else {
                            ans++;
                        }
                    }
                }
                else if (closestBig != null) {
                    if (Math.abs(closestBig - i) <= 2) {
                        ans += Math.abs(closestBig - i);
                        zeroError.remove(closestBig);
                    }
                    else {
                        ans++;
                    }
                }
                else if (closestSmall != null) {
                    if (Math.abs(closestSmall - i) <= 2) {
                        ans += Math.abs(closestSmall - i);
                        zeroError.remove(closestSmall);
                    }
                    else {
                        ans++;
                    }
                }
                else {
                    ans++;
                }
            }
            for (int key : zeroError.keySet()) {
                ans++;
            }
            out.write(Integer.toString(ans));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static class IndexVal {
        int index, val;

        public IndexVal(int index, int val) {
            this.index = index;
            this.val = val;
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int n = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            int ans[] = new int[n];
            Arrays.fill(ans, Integer.MAX_VALUE);
            if (a[0] == b[0]) {
                ans[0] = 0;
            }
            else {
                ans[0] = 1;
            }
            for (int i = 1; i < n; i++) {
                if (a[i] == b[i]) {
                    ans[i] = ans[i - 1];
                }
                else {
                    if (a[i - 1] != b[i - 1]) {
                        ans[i] = Math.min(ans[i], (i - 2 >= 0 ? ans[i - 2] : 0) + 1);
                    }
                    else {
                        ans[i] = ans[i - 1] + 1;
                    }
                }
            }
            out.write(Integer.toString(ans[n - 1]));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static class IndexVal {
        int index, val;

        public IndexVal(int index, int val) {
            this.index = index;
            this.val = val;
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * created by vidyut on 02/09/18
 **/

public class C {
    public static void main(String[] args) {
        try {
            InputReader in = new InputReader(System.in);
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            int len = in.readInt();
            char a[] = in.readLine().toCharArray();
            char b[] = in.readLine().toCharArray();
            TreeMap<Integer, Integer> zeroError = new TreeMap<>();
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '0') {
                    zeroError.put(i, 1);
                }
            }
            int ans = 0;
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i] && a[i] == '1') {
                    Integer closestBig = zeroError.ceilingKey(i);
                    Integer closestSmall = zeroError.floorKey(i);
                    if (closestBig != null && closestSmall != null) {
                        if (Math.abs(closestBig - i) <= Math.abs(closestSmall - i)) {
                            if (Math.abs(closestBig - i) <= 2) {
                                ans += Math.abs(closestBig - i);
                            }
                            else {
                                ans += 2;
                            }
                            zeroError.remove(closestBig);
                        }
                        else {
                            if (Math.abs(closestSmall - i) <= 2) {
                                ans += Math.abs(closestSmall - i);
                            }
                            else {
                                ans += 2;
                            }
                            zeroError.remove(closestSmall);
                        }
                    }
                    else if (closestBig != null) {
                        if (Math.abs(closestBig - i) <= 2) {
                            ans += Math.abs(closestBig - i);
                        }
                        else {
                            ans += 2;
                        }
                        zeroError.remove(closestBig);
                    }
                    else if (closestSmall != null) {
                        if (Math.abs(closestSmall - i) <= 2) {
                            ans += Math.abs(closestSmall - i);
                        }
                        else {
                            ans += 2;
                        }
                        zeroError.remove(closestSmall);
                    }
                    else {
                        ans++;
                    }
                }
            }
            for (int key : zeroError.keySet()) {
                ans++;
            }
            out.write(Integer.toString(ans));
            out.newLine();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int length = readInt();
        if (length < 0)
            return null;
        byte[] bytes = new byte[length];
        for (int i = 0; i < length; i++)
            bytes[i] = (byte) read();
        try {
            return new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public boolean readBoolean() {
        return readInt() == 1;
    }
}


import java.util.*;
import java.util.Map.Entry;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
		public final class Solve {
		static PrintWriter out = new PrintWriter(System.out);
		static void flush() {
	 	out.flush();
	 	}
		static void run(long s, long e) {
		NumberFormat formatter = new DecimalFormat("#0.00000");
		System.out.print("Execution time is " + formatter.format((e - s) / 1000d) + " seconds");
		}
		static int gcd(int a, int b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long gcd(long a, long b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long lcm(long a, long b) {
			return a*b/gcd(a, b);
		}
		static class FastReader {
	     static BufferedReader br;
	    StringTokenizer st;

	    public FastReader() {
	    br = new BufferedReader(new
	    InputStreamReader(System.in));
	    }
	    static boolean isPalindrome(String str1, String str2) {
	    String str3 = str1+str2;
	    int i = 0, j = str3.length()-1;
	    while(i < j) {
	    char a = str3.charAt(i), b = str3.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    static boolean isPalindrome(String str) {
	    int i = 0, j = str.length()-1;
	    while(i < j) {
	    char a = str.charAt(i), b = str.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    String next() {
	    while (st == null || !st.hasMoreElements()) {
	    try{st = new StringTokenizer(br.readLine());}
	    catch (IOException  e) {e.printStackTrace();}
	    }
	    return st.nextToken();
	    }
	    int nextInt(){ return Integer.parseInt(next()); }
	    long nextLong() { return Long.parseLong(next());}
	    static int fact(int n) {
	    if(n == 1) return 1;
	    return n * fact(n-1);
	   	}
	    public int[] readIntArray(int n) {
	    int[] arr = new int[n];
		for(int i=0; i<n; ++i)
		arr[i]=nextInt();
		return arr;
		}
	    public long[] readLongArray(int n) {
	    	long[] arr = new long[n];
	    	for(int i=0; i<n; ++i)
	    		arr[i]=nextLong();
	    	return arr;
	    }
	    public int[][] readIntArray(int m, int n){
		int[][] arr = new int[m][n];
		for(int i = 0;i<m;i++)
		for(int j = 0;j<n;j++)
		arr[i][j] = nextInt();
		return arr;
	    }
	    public String[] readStringArray(int n) {
		String[] arr = new String[n];
		for(int i=0; i<n; ++i)
		arr[i]= nextLine();
		return arr;
	    }
	    double nextDouble() {return Double.parseDouble(next());}
	    String nextLine() {
	    String str = "";
	    try{str = br.readLine();}
	    catch (IOException e) {e.printStackTrace();}
	    return str;}
	    }
		static void solve(char[] a, char[] b, int n) {
			int co = 0;
			for(int i = 0 ;i<n-1;i++) {
				if(a[i] == '1' && b[i] == '0') {
					if(a[i+1] == '0') {
						char c = a[i+1];
						a[i+1] = a[i];
						a[i] = c;
					}
					else if(b[i+1] == '1') {
						char c = b[i+1];
						b[i+1] = b[i];
						b[i] = c;
					}
					else {
						a[i] = '0';
					}
					co++;
				}
				else if(a[i] == '0' && b[i] == '1') {
					if(a[i+1] == '1') {
						char c = a[i+1];
						a[i+1] = a[i];
						a[i] = c;
					}
					else if(b[i+1] == '0') {
						char c = b[i+1];
						b[i+1] = b[i];
						b[i] = c;
					}
					else {
						a[i] = '1';
					}
					co++;
				}
			}
			out.println(co);
		}
		public static void main(String args[]) throws IOException {
	    FastReader sc = new FastReader();
	    long s1 = System.currentTimeMillis();
	   	int n = sc.nextInt();
	   	char[] a = sc.next().toCharArray();
	   	char[] b = sc.next().toCharArray();
	   	solve(a,b,n);
	    flush();
	    long e = System.currentTimeMillis();
//	    run(s1,e);
	    }
	}


import java.util.*;
import java.util.Map.Entry;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
		public final class Solve {
		static PrintWriter out = new PrintWriter(System.out);
		static void flush() {
	 	out.flush();
	 	}
		static void run(long s, long e) {
		NumberFormat formatter = new DecimalFormat("#0.00000");
		System.out.print("Execution time is " + formatter.format((e - s) / 1000d) + " seconds");
		}
		static int gcd(int a, int b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long gcd(long a, long b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long lcm(long a, long b) {
			return a*b/gcd(a, b);
		}
		static class FastReader {
	     static BufferedReader br;
	    StringTokenizer st;

	    public FastReader() {
	    br = new BufferedReader(new
	    InputStreamReader(System.in));
	    }
	    static boolean isPalindrome(String str1, String str2) {
	    String str3 = str1+str2;
	    int i = 0, j = str3.length()-1;
	    while(i < j) {
	    char a = str3.charAt(i), b = str3.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    static boolean isPalindrome(String str) {
	    int i = 0, j = str.length()-1;
	    while(i < j) {
	    char a = str.charAt(i), b = str.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    String next() {
	    while (st == null || !st.hasMoreElements()) {
	    try{st = new StringTokenizer(br.readLine());}
	    catch (IOException  e) {e.printStackTrace();}
	    }
	    return st.nextToken();
	    }
	    int nextInt(){ return Integer.parseInt(next()); }
	    long nextLong() { return Long.parseLong(next());}
	    static int fact(int n) {
	    if(n == 1) return 1;
	    return n * fact(n-1);
	   	}
	    public int[] readIntArray(int n) {
	    int[] arr = new int[n];
		for(int i=0; i<n; ++i)
		arr[i]=nextInt();
		return arr;
		}
	    public long[] readLongArray(int n) {
	    	long[] arr = new long[n];
	    	for(int i=0; i<n; ++i)
	    		arr[i]=nextLong();
	    	return arr;
	    }
	    public int[][] readIntArray(int m, int n){
		int[][] arr = new int[m][n];
		for(int i = 0;i<m;i++)
		for(int j = 0;j<n;j++)
		arr[i][j] = nextInt();
		return arr;
	    }
	    public String[] readStringArray(int n) {
		String[] arr = new String[n];
		for(int i=0; i<n; ++i)
		arr[i]= nextLine();
		return arr;
	    }
	    double nextDouble() {return Double.parseDouble(next());}
	    String nextLine() {
	    String str = "";
	    try{str = br.readLine();}
	    catch (IOException e) {e.printStackTrace();}
	    return str;}
	    }
		static void solve(char[] a, char[] b, int n) {
			int co = 0;
			for(int i = 0 ;i<n-1;i++) {
				if(a[i] == '1' && b[i] == '0') {
					if(a[i+1] == '0') {
						char c = a[i+1];
						a[i+1] = a[i];
						a[i] = c;
					}
					else if(b[i+1] == '1') {
						char c = b[i+1];
						b[i+1] = b[i];
						b[i] = c;
					}
					else {
						a[i] = '0';
					}
					co++;
				}
				else if(a[i] == '0' && b[i] == '1') {
					if(a[i+1] == '1') {
						char c = a[i+1];
						a[i+1] = a[i];
						a[i] = c;
					}
					else if(b[i+1] == '0') {
						char c = b[i+1];
						b[i+1] = b[i];
						b[i] = c;
					}
					else {
						a[i] = '1';
					}
					co++;
				}
			}
			if(a[n-1] != b[n-1]) {
				co++;
			}
			out.println(co);
		}
		public static void main(String args[]) throws IOException {
	    FastReader sc = new FastReader();
	    long s1 = System.currentTimeMillis();
	   	int n = sc.nextInt();
	   	char[] a = sc.next().toCharArray();
	   	char[] b = sc.next().toCharArray();
	   	solve(a,b,n);
	    flush();
	    long e = System.currentTimeMillis();
//	    run(s1,e);
	    }
	}


import java.util.*;
import java.util.Map.Entry;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
		public final class Solve {
		static PrintWriter out = new PrintWriter(System.out);
		static void flush() {
	 	out.flush();
	 	}
		static void run(long s, long e) {
		NumberFormat formatter = new DecimalFormat("#0.00000");
		System.out.print("Execution time is " + formatter.format((e - s) / 1000d) + " seconds");
		}
		static int gcd(int a, int b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long gcd(long a, long b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long lcm(long a, long b) {
			return a*b/gcd(a, b);
		}
		static class FastReader {
	     static BufferedReader br;
	    StringTokenizer st;

	    public FastReader() {
	    br = new BufferedReader(new
	    InputStreamReader(System.in));
	    }
	    static boolean isPalindrome(String str1, String str2) {
	    String str3 = str1+str2;
	    int i = 0, j = str3.length()-1;
	    while(i < j) {
	    char a = str3.charAt(i), b = str3.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    static boolean isPalindrome(String str) {
	    int i = 0, j = str.length()-1;
	    while(i < j) {
	    char a = str.charAt(i), b = str.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    String next() {
	    while (st == null || !st.hasMoreElements()) {
	    try{st = new StringTokenizer(br.readLine());}
	    catch (IOException  e) {e.printStackTrace();}
	    }
	    return st.nextToken();
	    }
	    int nextInt(){ return Integer.parseInt(next()); }
	    long nextLong() { return Long.parseLong(next());}
	    static int fact(int n) {
	    if(n == 1) return 1;
	    return n * fact(n-1);
	   	}
	    public int[] readIntArray(int n) {
	    int[] arr = new int[n];
		for(int i=0; i<n; ++i)
		arr[i]=nextInt();
		return arr;
		}
	    public long[] readLongArray(int n) {
	    	long[] arr = new long[n];
	    	for(int i=0; i<n; ++i)
	    		arr[i]=nextLong();
	    	return arr;
	    }
	    public int[][] readIntArray(int m, int n){
		int[][] arr = new int[m][n];
		for(int i = 0;i<m;i++)
		for(int j = 0;j<n;j++)
		arr[i][j] = nextInt();
		return arr;
	    }
	    public String[] readStringArray(int n) {
		String[] arr = new String[n];
		for(int i=0; i<n; ++i)
		arr[i]= nextLine();
		return arr;
	    }
	    double nextDouble() {return Double.parseDouble(next());}
	    String nextLine() {
	    String str = "";
	    try{str = br.readLine();}
	    catch (IOException e) {e.printStackTrace();}
	    return str;}
	    }
		static void solve(char[] a, char[] b, int n) {
			int co = 0;
			for(int i = 0 ;i<n-1;i++) {
				if(a[i] != b[i]) {
					if(a[i+1] == b[i+1]) {
						co++;
					}
					else if(a[i] == a[i+1]){
						a[i] = b[i];
						a[i+1] = b[i+1];
						co += 2;
					}
				}
			}
			if(a[n-1] != b[n-1]) {
				co++;
			}
			out.println(co);
		}
		public static void main(String args[]) throws IOException {
	    FastReader sc = new FastReader();
	    long s1 = System.currentTimeMillis();
	   	int n = sc.nextInt();
	   	char[] a = sc.next().toCharArray();
	   	char[] b = sc.next().toCharArray();
	   	solve(a,b,n);
	    flush();
	    long e = System.currentTimeMillis();
//	    run(s1,e);
	    }
	}


import java.util.*;
import java.util.Map.Entry;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
		public final class Solve {
		static PrintWriter out = new PrintWriter(System.out);
		static void flush() {
	 	out.flush();
	 	}
		static void run(long s, long e) {
		NumberFormat formatter = new DecimalFormat("#0.00000");
		System.out.print("Execution time is " + formatter.format((e - s) / 1000d) + " seconds");
		}
		static int gcd(int a, int b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long gcd(long a, long b) {
			if (b == 0) return a;
			return gcd(b, a % b);
		}
		static long lcm(long a, long b) {
			return a*b/gcd(a, b);
		}
		static class FastReader {
	     static BufferedReader br;
	    StringTokenizer st;

	    public FastReader() {
	    br = new BufferedReader(new
	    InputStreamReader(System.in));
	    }
	    static boolean isPalindrome(String str1, String str2) {
	    String str3 = str1+str2;
	    int i = 0, j = str3.length()-1;
	    while(i < j) {
	    char a = str3.charAt(i), b = str3.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    static boolean isPalindrome(String str) {
	    int i = 0, j = str.length()-1;
	    while(i < j) {
	    char a = str.charAt(i), b = str.charAt(j);
	    if(a != b) return false;
	    i++;j--;
	    }
	    return true;
	    }
	    String next() {
	    while (st == null || !st.hasMoreElements()) {
	    try{st = new StringTokenizer(br.readLine());}
	    catch (IOException  e) {e.printStackTrace();}
	    }
	    return st.nextToken();
	    }
	    int nextInt(){ return Integer.parseInt(next()); }
	    long nextLong() { return Long.parseLong(next());}
	    static int fact(int n) {
	    if(n == 1) return 1;
	    return n * fact(n-1);
	   	}
	    public int[] readIntArray(int n) {
	    int[] arr = new int[n];
		for(int i=0; i<n; ++i)
		arr[i]=nextInt();
		return arr;
		}
	    public long[] readLongArray(int n) {
	    	long[] arr = new long[n];
	    	for(int i=0; i<n; ++i)
	    		arr[i]=nextLong();
	    	return arr;
	    }
	    public int[][] readIntArray(int m, int n){
		int[][] arr = new int[m][n];
		for(int i = 0;i<m;i++)
		for(int j = 0;j<n;j++)
		arr[i][j] = nextInt();
		return arr;
	    }
	    public String[] readStringArray(int n) {
		String[] arr = new String[n];
		for(int i=0; i<n; ++i)
		arr[i]= nextLine();
		return arr;
	    }
	    double nextDouble() {return Double.parseDouble(next());}
	    String nextLine() {
	    String str = "";
	    try{str = br.readLine();}
	    catch (IOException e) {e.printStackTrace();}
	    return str;}
	    }
		static void solve(char[] a, char[] b, int n) {
			int co = 0;
			for(int i = 0;i<n-1;i++) {
				if(a[i] != b[i]) {
					if(a[i+1] == b[i+1]) {
						a[i] = b[i];
						co++;
					}
					else if(a[i] == a[i+1]){
						a[i] = b[i];
						co++;
					}
					else {
						a[i] = b[i];
						a[i+1] = b[i+1];
						co++;
					}
				}
			}
			if(a[n-1] != b[n-1]) {
				co++;
			}
			out.println(co);
		}
		public static void main(String args[]) throws IOException {
	    FastReader sc = new FastReader();
	    long s1 = System.currentTimeMillis();
	   	int n = sc.nextInt();
	   	char[] a = sc.next().toCharArray();
	   	char[] b = sc.next().toCharArray();
	   	solve(a,b,n);
	    flush();
	    long e = System.currentTimeMillis();
//	    run(s1,e);
	    }
	}


import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {

 //   public static int[] dp;

 //   public static int process(String a, String b, int i){
 //       if(a.charAt(i) != b.charAt(i)){
 //
 //       }
 //   }

    public static void main(String[] args){
        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        int n = cin.nextInt();
        String a = cin.next();
        String b = cin.next();
        int diff = 0;
        for(int i = 0; i < a.length(); i++){
            if(a.charAt(i) != b.charAt(i))
                diff++;
        }
        int adjacent = 0;
        for(int i = 0; i < a.length()-1; i++){
            if(a.charAt(i) == b.charAt(i))
                continue;
            if(a.charAt(i+1) != b.charAt(i+1)){
                adjacent++;
                i++;
            }
        }
        System.out.println(diff-adjacent);

    }
}


import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        int n = cin.nextInt();
        String a = cin.next();
        String b = cin.next();
        int diff = 0;
        for(int i = 0; i < a.length(); i++)
            if(a.charAt(i) != b.charAt(i))
                diff++;
        int adjacent = 0;
        for(int i = 0; i < a.length()-1; i++){
            if(a.charAt(i) == b.charAt(i))
                continue;
            if(a.charAt(i+1) != b.charAt(i+1) && a.charAt(i) != a.charAt(i+1)){
                    adjacent++;
                    i++;
            }
        }
        System.out.println(diff-adjacent);

    }
}


import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {

 //   public static int[] dp;

 //   public static int process(String a, String b, int i){
 //       if(a.charAt(i) != b.charAt(i)){
 //
 //       }
 //   }

    public static void main(String[] args){
        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        int n = cin.nextInt();
        String a = cin.next();
        String b = cin.next();
        int diff = 0;
        for(int i = 0; i < a.length(); i++){
            if(a.charAt(i) != b.charAt(i))
                diff++;
        }
        int adjacent = 0;
        for(int i = 0; i < a.length()-1; i++){
            if(a.charAt(i) == b.charAt(i))
                continue;
            if(a.charAt(i+1) != b.charAt(i+1)){
                if(a.charAt(i) != a.charAt(i+1)) {
                    adjacent++;
                    i++;
                }
            }
        }
        System.out.println(diff-adjacent);

    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String a = input.next();
        String b = input.next();
        System.out.println(Math.abs(a.compareTo(b)));

    }

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
       int n = input.nextInt();
       String s1 = input.next();
       String s2 = input.next();
       int count=0;
        for (int i = 0; i < n; i++) {
            if(s1.charAt(i)!=s2.charAt(i))
            {
                if(i!=n-1&&s1.charAt(i+1)!=s2.charAt(i+1)&&s1.charAt(i)!=s1.charAt(i+1))
                {
                    i++;
                    count++;
                }
                else
                    count++;
            }
        }
        System.out.println(count);

    }

}


import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        String a = input.next();
        String b = input.next();
        System.out.println(Math.abs(a.compareTo(b)));

    }

}


import java.util.*;

public class Main {
  static  Scanner input = new Scanner(System.in);
    public static void main(String[] args) {

            solve();

    }

    private static void solve() {
      int n = input.nextInt();
      String s1 =input.next();
      String s2 =input.next();
      int count=0;
        for (int i = 0; i < s1.length(); i++) {
            if(s1.charAt(i)!=s2.charAt(i))
            {
                if(i!=n-1&&s1.charAt(i+1)!=s2.charAt(i+1)&&s1.charAt(i+1)!=s1.charAt(i))
                {
                    count++;
                    i++;
                }
                else{
                    count++;
                }
            }
        }
        System.out.println(count);
    }

    private static long GCD(long n1, long n2) {
        if(n1==0)
            return n2;
        return GCD(n2%n1,n1);
    }

}


import java.io.*;
import java.math.*;
import java.util.*;
public class Equalize {

	public static void main(String[] args) {
		FastScanner I = new FastScanner(); //Input
		OutPut O = new OutPut(); //Output
		int N = I.nextInt();
		int ans = 0;
		char[] a = I.next().toCharArray();
		char[] b = I.next().toCharArray();
		for (int i = 0; i < N; i++) {
			if (i<N-1&&a[i]!=b[i]&&a[i+1]!=b[i+1]&&a[i]!=a[i+1]&&b[i]!=b[i+1]) {
				ans++;
				i++; //Swap optimization (a={1,0} and b={0,1} OR a={0,1} and b={1,0})
			}else if (a[i]!=b[i]) ans++; //Just invert the current bit otherwise
		}
		O.pln(ans);
	}
	public static long ceil(long num, long den) {long ans = num/den; if (num%den!=0)
	ans++; return ans;}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	public static int pop(long x) { //Returns number of bits within a number
		int cnt = 0;
		while (x>0) {
			if (x%2==1) cnt++;
			x/=2;
		}
		return cnt;
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
	}
	static class OutPut{
		PrintWriter w = new PrintWriter(System.out);
		void pln(double x) {w.println(x);w.flush();}
		void pln(int x) {w.println(x);w.flush();}
		void pln(long x) {w.println(x);w.flush();}
		void pln(String x) {w.println(x);w.flush();}
		void pln(char x) {w.println(x);w.flush();}
		void pln(StringBuilder x) {w.println(x);w.flush();}
		void pln(BigInteger x) {w.println(x);w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
		void p(StringBuilder x) {w.print(x);w.flush();}
		void p(BigInteger x) {w.print(x);w.flush();}
		void p(double x) {w.print(x);w.flush();}
	}
}