#include using namespace std; typedef long long LL; typedef long double LD; typedef pair < int, int > PII; typedef pair < LL, LL > PLL; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() int cnt[4][4]; char MP[256]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); MP['C'] = 1; MP['G'] = 2; MP['T'] = 3; int n; string s, t; cin >> s >> t; n = sz(s); for(int i = 0; i < n; i++) { if(s[i] != t[i]) cnt[MP[s[i]]][MP[t[i]]]++; } int ans = 0; for(int i = 0; i < 4; i++) { for(int j = i + 1; j < 4; j++) { int x = min(cnt[i][j], cnt[j][i]); ans += x; cnt[i][j] -= x; cnt[j][i] -= x; } } for(int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { for(int k = 0; k < 4; k++) { if(i != j && i != k && j != k) { int x = min({cnt[i][j], cnt[j][k], cnt[k][i]}); ans += 2 * x; cnt[i][j] -= x; cnt[j][k] -= x; cnt[k][i] -= x; } } } } int tmp = 0; for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) tmp += cnt[i][j]; assert(tmp % 4 == 0); ans += (tmp / 4) * 3; cout << ans << "\n"; return 0; }