#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
const long double pi = acos(-1.0);
const int_fast32_t mod = 1e9 + 7;
struct pr {
  int_fast32_t x = 0;
  int_fast32_t y = 0;
  int_fast32_t dst = 0;
  pr() {}
  pr(int_fast32_t x, int_fast32_t y, int_fast32_t dst) : x(x), y(y), dst(dst) {}
  inline bool operator<(const pr& cmp2) const {
    if (dst != cmp2.dst) return dst < cmp2.dst;
    if (x != cmp2.x) return x < cmp2.x;
    return y < cmp2.y;
  }
  inline bool operator==(const pr& cmp2) const {
    return (cmp2.dst == dst) && (cmp2.x == x) && (cmp2.y == y);
  }
  inline bool operator>(const pr& cmp2) const {
    if (dst != cmp2.dst) return dst > cmp2.dst;
    if (x != cmp2.x) return x > cmp2.x;
    return y > cmp2.y;
  }
};
struct point {
  int_fast32_t x = 0;
  int_fast32_t y = 0;
  point() {}
  point(int_fast32_t x, int_fast32_t y) : x(x), y(y) {}
  inline bool operator<(const point& cmp2) const {
    if (cmp2.x != x) return cmp2.x < x;
    return cmp2.y < y;
  }
  inline bool operator==(const point& cmp2) const {
    return (cmp2.x == x) && (cmp2.y == y);
  }
  inline bool operator>(const point& cmp2) const {
    if (cmp2.x != x) return cmp2.x > x;
    return cmp2.y > y;
  }
};
namespace std {
template <typename T>
struct hash<vector<T> > {
  size_t operator()(const vector<T>& k) const {
    size_t ret = 0xf3ee477d;
    for (size_t i = 0; i != k.size(); ++i) ret ^= hash(hash(k[i]) + i);
    return ret;
  }
};
template <>
struct hash<pr> {
  size_t operator()(const pr& cmp1) const {
    return (hash<int_fast32_t>()(cmp1.x)) ^ (hash<int_fast32_t>()(cmp1.y)) ^
           (hash<int_fast32_t>()(cmp1.dst));
  }
};
template <>
struct hash<point> {
  size_t operator()(const point& cmp1) const {
    return (hash<int_fast32_t>()(cmp1.x)) ^ (hash<int_fast32_t>()(cmp1.y));
  }
};
}  // namespace std
inline bool spoint(const point& cmp1, const point& cmp2) {
  if (cmp1.x != cmp2.x) return cmp1.x < cmp2.x;
  return cmp1.y < cmp2.y;
}
inline bool spr(const pr& cmp1, const pr& cmp2) {
  if (cmp1.dst != cmp2.dst) return cmp1.dst < cmp2.dst;
  if (cmp1.x != cmp2.x) return cmp1.x < cmp2.x;
  return cmp1.y < cmp2.y;
}
void sub() {}
void solve() {
  string s, t;
  cin >> s >> t;
  int_fast32_t n = s.length(), m = t.length();
  int_fast32_t cur = 0;
  vector<int_fast32_t> pre(n), suff(n);
  for (int_fast32_t i = (int_fast32_t)0; i < (int_fast32_t)n; ++i) {
    if (cur < m && t[cur] == s[i]) {
      ++cur;
    }
    pre[i] = cur - 1;
  }
  cur = m - 1;
  for (int_fast32_t i = (int_fast32_t)n - 1; i >= (int_fast32_t)0; --i) {
    if (cur >= 0 && t[cur] == s[i]) {
      --cur;
    }
    suff[i] = cur + 1;
  }
  int_fast32_t ans = 0;
  for (int_fast32_t i = (int_fast32_t)0; i < (int_fast32_t)n; ++i) {
    for (int_fast32_t j = (int_fast32_t)i; j < (int_fast32_t)n; ++j) {
      if (i == 0 && j == n - 1) continue;
      if (i == 0) {
        if (suff[j + 1] == 0) {
          ans = (ans < j - i + 1 ? j - i + 1 : ans);
        }
        continue;
      }
      if (j == n - 1) {
        if (pre[i - 1] == m - 1) {
          ans = (ans < j - i + 1 ? j - i + 1 : ans);
        }
        continue;
      }
      if (pre[i - 1] + 1 >= suff[j + 1]) {
        ans = (ans < j - i + 1 ? j - i + 1 : ans);
      }
    }
  }
  cout << ans << endl;
}
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(0));
}
int main() {
  init();
  solve();
  return 0;
}

### Prompt

In cpp, your task is to solve the following problem:

The only difference between easy and hard versions is the length of the string.

You are given a string s and a string t, both consisting only of lowercase Latin letters. It is guaranteed that t can be obtained from s by removing some (possibly, zero) number of characters (not necessary contiguous) from s without changing order of remaining characters (in other words, it is guaranteed that t is a subsequence of s).

For example, the strings "test", "tst", "tt", "et" and "" are subsequences of the string "test". But the strings "tset", "se", "contest" are not subsequences of the string "test".

You want to remove some substring (contiguous subsequence) from s of maximum possible length such that after removing this substring t will remain a subsequence of s.

If you want to remove the substring s[l;r] then the string s will be transformed to s_1 s_2 ... s_{l-1} s_{r+1} s_{r+2} ... s_{|s|-1} s_{|s|} (where |s| is the length of s).

Your task is to find the maximum possible length of the substring you can remove so that t is still a subsequence of s.

Input

The first line of the input contains one string s consisting of at least 1 and at most 200 lowercase Latin letters.

The second line of the input contains one string t consisting of at least 1 and at most 200 lowercase Latin letters.

It is guaranteed that t is a subsequence of s.

Output

Print one integer — the maximum possible length of the substring you can remove so that t is still a subsequence of s.

Examples

Input


bbaba
bb


Output


3


Input


baaba
ab


Output


2


Input


abcde
abcde


Output


0


Input


asdfasdf
fasd


Output


3

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
const long double pi = acos(-1.0);
const int_fast32_t mod = 1e9 + 7;
struct pr {
  int_fast32_t x = 0;
  int_fast32_t y = 0;
  int_fast32_t dst = 0;
  pr() {}
  pr(int_fast32_t x, int_fast32_t y, int_fast32_t dst) : x(x), y(y), dst(dst) {}
  inline bool operator<(const pr& cmp2) const {
    if (dst != cmp2.dst) return dst < cmp2.dst;
    if (x != cmp2.x) return x < cmp2.x;
    return y < cmp2.y;
  }
  inline bool operator==(const pr& cmp2) const {
    return (cmp2.dst == dst) && (cmp2.x == x) && (cmp2.y == y);
  }
  inline bool operator>(const pr& cmp2) const {
    if (dst != cmp2.dst) return dst > cmp2.dst;
    if (x != cmp2.x) return x > cmp2.x;
    return y > cmp2.y;
  }
};
struct point {
  int_fast32_t x = 0;
  int_fast32_t y = 0;
  point() {}
  point(int_fast32_t x, int_fast32_t y) : x(x), y(y) {}
  inline bool operator<(const point& cmp2) const {
    if (cmp2.x != x) return cmp2.x < x;
    return cmp2.y < y;
  }
  inline bool operator==(const point& cmp2) const {
    return (cmp2.x == x) && (cmp2.y == y);
  }
  inline bool operator>(const point& cmp2) const {
    if (cmp2.x != x) return cmp2.x > x;
    return cmp2.y > y;
  }
};
namespace std {
template <typename T>
struct hash<vector<T> > {
  size_t operator()(const vector<T>& k) const {
    size_t ret = 0xf3ee477d;
    for (size_t i = 0; i != k.size(); ++i) ret ^= hash(hash(k[i]) + i);
    return ret;
  }
};
template <>
struct hash<pr> {
  size_t operator()(const pr& cmp1) const {
    return (hash<int_fast32_t>()(cmp1.x)) ^ (hash<int_fast32_t>()(cmp1.y)) ^
           (hash<int_fast32_t>()(cmp1.dst));
  }
};
template <>
struct hash<point> {
  size_t operator()(const point& cmp1) const {
    return (hash<int_fast32_t>()(cmp1.x)) ^ (hash<int_fast32_t>()(cmp1.y));
  }
};
}  // namespace std
inline bool spoint(const point& cmp1, const point& cmp2) {
  if (cmp1.x != cmp2.x) return cmp1.x < cmp2.x;
  return cmp1.y < cmp2.y;
}
inline bool spr(const pr& cmp1, const pr& cmp2) {
  if (cmp1.dst != cmp2.dst) return cmp1.dst < cmp2.dst;
  if (cmp1.x != cmp2.x) return cmp1.x < cmp2.x;
  return cmp1.y < cmp2.y;
}
void sub() {}
void solve() {
  string s, t;
  cin >> s >> t;
  int_fast32_t n = s.length(), m = t.length();
  int_fast32_t cur = 0;
  vector<int_fast32_t> pre(n), suff(n);
  for (int_fast32_t i = (int_fast32_t)0; i < (int_fast32_t)n; ++i) {
    if (cur < m && t[cur] == s[i]) {
      ++cur;
    }
    pre[i] = cur - 1;
  }
  cur = m - 1;
  for (int_fast32_t i = (int_fast32_t)n - 1; i >= (int_fast32_t)0; --i) {
    if (cur >= 0 && t[cur] == s[i]) {
      --cur;
    }
    suff[i] = cur + 1;
  }
  int_fast32_t ans = 0;
  for (int_fast32_t i = (int_fast32_t)0; i < (int_fast32_t)n; ++i) {
    for (int_fast32_t j = (int_fast32_t)i; j < (int_fast32_t)n; ++j) {
      if (i == 0 && j == n - 1) continue;
      if (i == 0) {
        if (suff[j + 1] == 0) {
          ans = (ans < j - i + 1 ? j - i + 1 : ans);
        }
        continue;
      }
      if (j == n - 1) {
        if (pre[i - 1] == m - 1) {
          ans = (ans < j - i + 1 ? j - i + 1 : ans);
        }
        continue;
      }
      if (pre[i - 1] + 1 >= suff[j + 1]) {
        ans = (ans < j - i + 1 ? j - i + 1 : ans);
      }
    }
  }
  cout << ans << endl;
}
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(0));
}
int main() {
  init();
  solve();
  return 0;
}

```