using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { var nn = Console.ReadLine().Split().Select(int.Parse).ToArray(); var sa = Console.ReadLine(); var sb = Console.ReadLine(); int na = Math.Min(sa.Count(c => c == 'A'), sb.Count(c => c == 'A')); int nb = Math.Min(sa.Count(c => c == 'B'), sb.Count(c => c == 'B')); Console.WriteLine(na + nb); Console.ReadLine(); } } }