Ichthyology
Scientists of Nearsea Institute of Linguistic Ichthyology study the fish language. They found few specific sounds which some fishes can emit, and assign letters of Latin alphabet to them. Then they took an underwater sound record and used state-of-the-art pattern recognition software to convert it into a string of letters.
They hypothesize that one sub-string of letters may have particular meaning in the fish language (and so serve as a kind of "word"), and so they want to calculate how often that sub-string may have been used during the record.
You program must, given the strings T and W, find minimum and maximum number of non-overlapping occurrences of W in T.
For example, if W = "abab" and T = "ababbbabababab", the string may be interpreted as "(abab)bb(abab)(abab)"(giving 3 occurrences) or as "(abab)bbab(abab)ab" (giving 2 occurrences). So, the minimal number is 2 and the maximum is 3.
Input
First line of input file contains string W (1 ≤ length(W) ≤ 100). Second line of input file contains string T (1 ≤ length(T) ≤ 1000). W and T contain small Latin letters only.
Output
Output file should contain two integers — minimum and maximum number of non-overlapping occurrences of W in T.