{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X \u003d \u0026lt; x1, x2, ..., xm \u0026gt; another sequence Z \u003d \u0026lt; z1, z2, ..., zk \u0026gt; is a subsequence of X if there exists a strictly increasing sequence \u0026lt; i1, i2, ..., ik \u0026gt; of indices of X such that for all j \u003d 1,2,...,k, x\n \u003csub\u003ei\u003csub\u003ej\u003c/sub\u003e\u003c/sub\u003e \u003d zj. For example, Z \u003d \u0026lt; a, b, f, c \u0026gt; is a subsequence of X \u003d \u0026lt; a, b, c, f, b, c \u0026gt; with index sequence \u0026lt; 1, 2, 4, 6 \u0026gt;. Given two sequences X and Y the problem is to find the length of the maximum-length common subsequence of X and Y. \n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The program input is from the std input. Each data set in the input contains two strings representing the given sequences. The max length of string is less than 1000. The sequences are separated by any number of white spaces. The input data are correct.\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For each set of data the program prints on the standard output the length of the maximum-length common subsequence from the beginning of a separate line. \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003eabcfbc abfcab\nprogramming contest \nabcd mnp\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e4\n2\n0\u003c/pre\u003e"}}]}