import sequtils,strutils var a1 = stdin.readline a2 = stdin.readline ans = 0 a1 &= a2 for i in 0..a1.high: for j in 0..a1.high: if i + j > a1.high: break if a1[i + j] != a1[i]: break ans = max(j + 1, ans) echo ans