#include using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) int f(char c) { if (c == 'A') return 0; if (c == 'C') return 1; if (c == 'G') return 2; if (c == 'T') return 3; } int main(void){ string s1, s2; cin >> s1 >> s2; vector> t(4, vector(4)); for (int i = 0; i < s1.size(); i++) t[f(s1[i])][f(s2[i])]++; int ans = 0; for (int i = 0; i < 4; i++) for (int j = 0; j < i; j++) { int x = min(t[i][j], t[j][i]); t[i][j] -= x; t[j][i] -= x; ans += x; } for (vector c : vector>{{0,1,2}, {0,1,3}, {0,2,3}, {1,2,3}}) do { int x = 1e9; for (int i = 0; i < 2; i++) x = min(x, t[c[i]][c[i+1]]); x = min(x, t[c[2]][c[0]]); ans += 2*x; for (int i = 0; i < 2; i++) t[c[i]][c[i+1]] -= x; t[c[2]][c[0]] -= x; } while (next_permutation(c.begin(), c.end())); vector c{0,1,2,3}; do { int x = 1e9; for (int i = 0; i < 3; i++) x = min(x, t[c[i]][c[i+1]]); x = min(x, t[c[3]][c[0]]); ans += 3*x; for (int i = 0; i < 3; i++) t[c[i]][c[i+1]] -= x; t[c[3]][c[0]] -= x; } while (next_permutation(c.begin(), c.end())); cout << ans << endl; }