using System; using System.Linq; namespace y { class Program { static void Main(string[] args) { Console.ReadLine(); var n = Console.ReadLine(); var m = Console.ReadLine(); var a = Math.Min(n.Count(x => x == 'A'), m.Count(x => x == 'A')); var b = Math.Min(n.Count(x => x == 'B'), m.Count(x => x == 'B')); Console.WriteLine(a + b); } } }