LearnPy Hub
← Arena
AdvancedRating 1500

Longest Common Subsequence

Print the length of the longest common subsequence of two strings (each ≤ 1000 characters).

Input

Two lines.

Output

A length.

Sample 1

Input
abcde
ace
Output
3

Sample 2

Input
abc
def
Output
0
solution.py
Output appears here
Longest Common Subsequence · Python Arena problem · LearnPy Hub