#include<bits/stdc++.h>

using namespace std;

int cnt, amount;

int arr[6];
string pairs[] = {"AC", "AG", "AT", "CG", "CT", "GT"};

vector <int> trans (pair <char, char> c) {
	vector <int> ans;
	for (int i = 0; i < 6; i++) {
		if ((pairs[i][0] == c.first && pairs[i][1] == c.second)||
			(pairs[i][1] == c.first && pairs[i][0] == c.second)) {
			ans.push_back (i);
			break;
		}
	}
	
	if (c.first < c.second) ans.push_back (1);
	else ans.push_back (-1);
	
	return ans;
}

int sgn (int x) {
	if (x < 0) return -1;
	else if (x > 0) return 1;
	else return 0;
}

void give (int index, int add) {
	if (sgn (arr[index]) == -add) cnt++;
	arr[index] += add;
}

bool orient (vector <int> x) {
		return sgn (arr[x[0]]) == x[1];
}

void tri (string src) {
	auto x = trans ({src[0], src[1]});
	auto y = trans ({src[1], src[2]});
	auto z = trans ({src[2], src[0]});
	
	if (orient (x) && orient (y) && orient (z)) {
		auto take = min (abs (arr[x[0]]), min (abs (arr[y[0]]), abs (arr[x[0]])));
		cnt += 2 * take;
		arr[x[0]] -= take * x[1];
		arr[y[0]] -= take * y[1];
		arr[z[0]] -= take * z[1];
	}
}

int main ()
{
	ios::sync_with_stdio (0);
	string A, B;
	cin >> A >> B;
	
	for (int i = 0; i < (int) A.size (); i++) {
		if (A[i] != B[i]) {
			auto v = trans ({A[i], B[i]});
			give (v[0], v[1]);
		}
	}
	
	string lex[] = {"A", "C", "G", "T"};
	
	for (int a = 0; a < 2; a++)
		for (int b = a + 1; b < 3; b++)
			for (int c = b + 1; c < 4; c++) {
				string src = lex[a] + lex[b] + lex[c];
				tri (src);
				src = lex[a] + lex[c] + lex[b];
				tri (src);
			}
			
	
	
	amount = -1;
	
	for (int i = 0; i < 6; i++) {
		if (arr[i]) {
			amount = abs (arr[i]);
			break;
		}
	}
	
	if (amount != -1) cnt += 3 * amount;
	cout << cnt;
	
	return 0;
}


