#K43362. Make Anagram

    ID: 27293 Type: Default 1000ms 256MiB

Make Anagram

Make Anagram

Given two strings, the goal is to determine the minimum number of character deletions required to make the two strings anagrams of each other.

Anagrams are strings that contain the same characters with the same frequency (the order does not matter). However, in this task you are only allowed to delete characters from the strings.

For example, given s₁ = (cde) and s₂ = (abc), you need to delete 'd' and 'e' from the first string and 'a' and 'b' from the second string, leaving only 'c' in both strings. Thus, the minimum number of deletions is 4.

Your task is to compute and output this minimum number of deletions.

inputFormat

The input consists of two lines. The first line contains the string (s_1) and the second line contains the string (s_2). Both strings may be empty.

outputFormat

Output a single integer which is the minimum number of deletions required so that the two strings become anagrams of each other.## sample

cde
abc
4