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

public class NaebbiracPhrases  {

	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	static StringTokenizer st = new StringTokenizer("");

	public static String next() {
		try	{
		while (!st.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null)
				return null;
			st = new StringTokenizer(s);
		}
		return st.nextToken();
		}	catch(Exception e)	{
			return	null;
		}
	}
	public static void main(String[] asda) throws Exception {
		int CASES = Integer.parseInt( next() );
		while	(CASES-- > 0)	{
			String s = next();
			String t = next();
			int ans = 0;
			for (int k = 0; k < s.length(); k++)
				ans += s.charAt(k) != t.charAt(k) ? 1 : 0;
			out.println(ans);
		}
        //
        out.flush();
        System.exit(0);
    }
	
}