#include #define ll long long #define ld long double #define fi first #define se second #define pll pair #define INF (1ll << 60) #define ppl pair #define vl vector #define vi vector #define vvi vector #define vvl vector #define vb vector #define FOR(i,a,b) for(ll i=a;i 0){ // cout << "connect " << x << i << endl; res = dfs(tab, vis, d , i); if(res >= 0){ res++; tab[x][i]--; break; } } } vis[x] = true; return res; } int c_to_int(char c){ switch (c) { case 'C': return 0; case 'G': return 1; case 'A': return 2; case 'T': return 3; default: return -1; } } int main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); string in, out; cin >> in >> out; vb vis(4, true); vvi tab(4, vi(4, 0)); ll res = 0; FOR(i, 0, in.size()){ if(in[i] != out[i]){ int x = c_to_int(in[i]); int y = c_to_int(out[i]); // cout << x << " " << y << endl; ll tmp = dfs(tab, vis, x, y); // cout << tmp << endl; if(tmp > 0){ res += tmp; } else { tab[x][y]++; } } } cout << res << endl; return 0; }