#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t–){
string s1,s2;
cin>>s1>>s2;
int len1=s1.length(),len2=s2.length();
long long count=0;
if(len1<=len2){
for(int i=0;i<len1;i++){
if(s1[i]==s2[i])
continue;
else
count++;
}
count +=len2-len1;
cout<<count<<"\n";
}
else{
for(int i=0;i<len2;i++){
if(s1[i]==s2[i])
continue;
else
count++;
}
count +=len1-len2;
cout<<count<<"\n";
}
}
return 0;
}