#K75637. Minimum Deletions to Make Anagrams

    ID: 34464 Type: Default 1000ms 256MiB

Minimum Deletions to Make Anagrams

Minimum Deletions to Make Anagrams

Given two strings \(A\) and \(B\), determine the minimum number of character deletions required to make the two strings anagrams of each other. Two strings are anagrams if they contain the same characters in the same frequency, regardless of order.

For example, if \(A = \texttt{cde}\) and \(B = \texttt{abc}\), removing \(d\) and \(e\) from \(A\), and \(a\) and \(b\) from \(B\) would result in the common character \(c\), so the answer is 4 deletions.

Your task is to compute this minimum number of deletions.

inputFormat

The input consists of two lines. The first line contains the string \(A\) and the second line contains the string \(B\). The strings consist of lowercase English letters and may be empty.

outputFormat

Output a single integer denoting the minimum number of character deletions required to make the two strings anagrams of each other.

## sample
cde
abc
4