Hellishly Fast Common Subsequence#5473

Hellishly Fast Common Subsequence

1 second
256 megabytes
Hard

Given two strings consisting of zeros and ones, find the length of their longest common subsequence.

Input

Two strings are given, each of length no more than .

Output

Output a single number — the length of their longest common subsequence.

Examples

Example 1

Loading
Loading