#K79717. String Similarity Score

    ID: 35371 Type: Default 1000ms 256MiB

String Similarity Score

String Similarity Score

Given two strings, this problem asks you to compute a similarity score. The similarity score is defined as the number of positions i (starting from 0) for which the characters in both strings are the same. More formally, if the two strings are \( s_1 \) and \( s_2 \), and if \( n = \min(|s_1|, |s_2|) \), then the similarity score is given by:

\( Score = \sum_{i=0}^{n-1} \mathbb{I}(s_1[i] = s_2[i]) \)

where \( \mathbb{I}(condition) \) is 1 if the condition is true and 0 otherwise. Your task is to implement this functionality.

inputFormat

The input consists of two lines. The first line contains the first string \( s_1 \) and the second line contains the second string \( s_2 \). Both strings can contain any visible characters. Note that the strings may have different lengths.

outputFormat

Output a single integer - the similarity score computed as the number of matching characters at the same positions in the two strings.

## sample
abcd
abcd
4