#include #define FOR(i,s,e) for(int i=(s); i<=(e); i++) #define FORD(i,s,e) for(int i=(s); i>=(e); i--) #define ALL(k) (k).begin(),(k).end() #define e1 first #define e2 second #define pb push_back using namespace std; using LL = long long; const int MAXN = 1000111; int edg[5][5]; char a[MAXN],b[MAXN]; int getval(char aa){ if (aa == 'A') return 1; if (aa == 'C') return 2; if (aa == 'G') return 3; return 4; } main(){ scanf("%s",a+1); scanf("%s",b+1); int l = strlen(a+1); FOR(i,1,l){ int x = getval(a[i]), y = getval(b[i]); edg[x][y]++; } FOR(x,1,4) edg[x][x] = 0; int ans = 0; FOR(x,1,4){ FOR(y,1,4){ if(x==y) continue; int ch = min(edg[x][y], edg[y][x]); ans += ch; edg[x][y] -= ch; edg[y][x] -= ch; } } FOR(x,1,4){ FOR(y,1,4){ if(x == y) continue; FOR(z,1,4){ if (x == y || y == z || z == x) continue; int ch = min(edg[x][y], min(edg[y][z], edg[z][x])); ans += 2*ch; edg[x][y] -= ch; edg[y][z] -= ch; edg[z][x] -= ch; } } } FOR(x,1,4){ FOR(y,1,4){ if(x == y) continue; FOR(z,1,4){ if (x == y || y == z || z == x) continue; FOR(t,1,4){ if(t == x || t == y || t == z) continue; int ch = min(min(edg[x][y],edg[y][z]), min(edg[z][t], edg[t][x])); ans += 3*ch; edg[x][y] -= ch; edg[y][z] -= ch; edg[z][t] -= ch; edg[t][x] -= ch; } } } } printf("%d\n", ans); return 0; }