//Kartik Alle
//February 4, 2020
//Int5
//Enloe
//Potter

#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;

ifstream myfile ("F:\\2inttest.txt");

vector  s1;
vector  s2;
int finalsum = 0;

void input() {
	string line, w1, w2;
    getline(myfile, line);
    w1 = line.substr(0, line.find(' '));
    w2 = line.substr(line.find(' ') + 1, line.length());
    for(int i = 0; i < w1.length(); i++)
        s1.push_back(w1[i]);
    for(int i = 0; i < w2.length(); i++)
        s2.push_back(w2[i]);
}

void makesamesize() {
if (s1.size() > s2.size()) {
    for (int i = 0; i < s1.size() - s2.size(); i++)
    	s2.push_back('.');
  }
  if (s1.size() < s2.size()) {
    for (int i = 0; i < s2.size() - s1.size(); i++)
    s1.push_back('.');
    }
}
void deletethings() {
	makesamesize();
	for (int i = 0; i < s1.size(); i++) {
		if (s1[i] == s2[i]) {
		s1.erase(s1.begin() + i);
		s2.erase(s2.begin() + i);
		i = i-1;
		}
	}
}

void cross() {
for (int i = 0; i < s1.size() - 1; i++) {
    if (s1[i] == s2[i+1]) {
      s2.erase(s2.begin() + i);
      break;
    }
    else if(s2[i] == s1[i + 1]) {
      s1.erase(s1.begin() + i);
      break;
    }
  }
}

void calculate() {
	int test = 0;
	for (int i = 0; i < s1.size(); i++) {
		if ((isalpha(s1[i]) != 0 )&& (isalpha(s2[i]) != 0))
			finalsum += s1[i] - s2[i];
		else
			test++;
	}
	finalsum = finalsum + test;
	cout << finalsum << endl;
}


int main() {
	for (int i = 0; i < 5; i++) {
		s1.clear();
		s2.clear();
		finalsum = 0;
		input();
		for (int j = 0; j < s1.size(); j++) {
			deletethings();
			cross();
		}
		calculate();
	}

  return 0;
}