You are given two strings A and B representing essays of two students who are suspected cheaters. For any two strings C, D we define their similarity score S(C,D) as 4⋅ LCS(C,D) - |C| - |D|, where LCS(C,D) denotes the length of the Longest Common Subsequence of strings C and D. 

You believe that only some part of the essays could have been copied, therefore you're interested in their substrings.

Calculate the maximal similarity score over all pairs of substrings. More formally, output maximal S(C, D) over all pairs (C, D), where C is some substring of A, and D is some substring of B. 

If X is a string, |X| denotes its length.

A string a is a substring of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.

A string a is a subsequence of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters. 

Pay attention to the difference between the substring and subsequence, as they both appear in the problem statement. 

You may wish to read the [Wikipedia page about the Longest Common Subsequence problem](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem).

Input

The first line contains two positive integers n and m (1 ≤ n, m ≤ 5000) — lengths of the two strings A and B. 

The second line contains a string consisting of n lowercase Latin letters — string A.

The third line contains a string consisting of m lowercase Latin letters — string B. 

Output

Output maximal S(C, D) over all pairs (C, D), where C is some substring of A, and D is some substring of B. 

Examples

Input


4 5
abba
babab


Output


5

Input


8 10
bbbbabab
bbbabaaaaa


Output


12

Input


7 7
uiibwws
qhtkxcn


Output


0

Note

For the first case:

abb from the first string and abab from the second string have LCS equal to abb.

The result is S(abb, abab) = (4 ⋅ |abb|) - |abb| - |abab| = 4 ⋅ 3 - 3 - 4 = 5.
#include <bits/stdc++.h>
using namespace std;
const long long N = 1000001;
const long long MOD = 998244353;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    y = y >> 1;
    y %= MOD;
    x = x * x;
    x %= MOD;
  }
  return res;
}
const long long intialize = 10001;
struct segT {
  long long node[1 << 21];
  void update(long long l, long long r, long long now, long long des,
              long long dta) {
    if (des < l || r < des) return;
    if (l == r) {
      node[now] += dta;
      return;
    }
    long long m = (l + r) >> 1;
    update(l, m, now * 2, des, dta);
    update(m + 1, r, now * 2 + 1, des, dta);
    node[now] = node[now * 2] + node[now * 2 + 1];
  }
  long long query(long long l, long long r, long long now, long long odr,
                  long long sum) {
    if (l == r) return r - (sum + node[now] >= odr);
    long long m = (l + r) >> 1;
    if (sum + node[now * 2] >= odr)
      return query(l, m, now * 2, odr, sum);
    else
      return query(m + 1, r, now * 2 + 1, odr, sum + node[now * 2]);
  }
} tree;
void precom(long long n) {
  if (n <= 0) return;
  long long mus = 1;
  mus++;
  mus += 2762;
  mus += 764;
  mus += 543;
  return precom(n - 1);
}
const long long average = 1021;
const long long MAX = 100001;
bool prime[MAX];
void sieve() {
  long long i, j;
  prime[0] = prime[1] = true;
  for (i = 4; i < MAX; i += 2) prime[i] = true;
  for (i = 3; i * i <= MAX; i += 2)
    if (!prime[i])
      for (j = i * i; j < MAX; j += 2 * i) prime[j] = true;
}
void previon(long long n) {
  if (n <= 0) return;
  long long skuti = 1;
  skuti++;
  skuti += 31;
  skuti += 64;
  return previon(n - 1);
}
bool yes = true;
long long oddDiv(long long n) {
  while (n > 1 && n % 2 == 0) n /= 2;
  if (n % 2 == 0 || n == 1) yes = false;
  return n;
}
void pre(long long n) {
  if (n <= 0) return;
  long long skk = 1;
  skk++;
  skk += 762;
  skk += 764;
  return pre(n - 1);
}
bool isprime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long getmex(string s) {
  if (s.size() == 0) {
    return 0;
  }
  long long count = 0;
  for (long long i = 0; i < s.size(); i++) {
    if ((s[i] - '0') != count) {
      return count;
    }
    count++;
  }
  return count;
}
long long subsetMex(long long* arr, long long n) {
  string A = "";
  string B = "";
  A += arr[0] + '0';
  for (long long i = 1; i < n; i++) {
    if (arr[i] == (A[A.size() - 1] - '0')) {
      B += arr[i] + '0';
    } else {
      A += arr[i] + '0';
    }
  }
  long long mexA = getmex(A);
  long long mexB = getmex(B);
  return mexA + mexB;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long tillDone = 10;
void precomputation() {
  long long operation = 1;
  while (operation < tillDone) {
    pre(intialize);
    precom(average);
    previon(average);
    operation++;
  }
  return;
}
long long checkMSB(long long a) {
  long long i = 0;
  long long loc = 0;
  while (a > 0) {
    if ((a & 1) == 1) {
      loc = i;
    }
    i++;
    a = a >> 1;
  }
  return loc;
}
long long digit[N];
double distance(double a, double b, double c, double d) {
  double ans = pow((c - a), 2) + pow((d - b), 2);
  ans = sqrt(ans);
  return ans;
}
long long power(long long a, long long b, long long mod) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > mod) x %= mod;
    }
    y = (y * y);
    if (y > mod) y %= mod;
    b /= 2;
  }
  return x;
}
long long mod(long long x) {
  if (x >= 0) {
    return x;
  }
  return -x;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  sieve();
  precomputation();
  long long t = 1;
  double pi = 2 * asin(1.0);
  for (long long tt = 1; tt <= t; tt++) {
    long long n, m;
    cin >> n >> m;
    string s, t;
    cin >> s >> t;
    long long ans = INT_MIN;
    long long dp[n + 1][m + 1];
    memset(dp, 0, sizeof(dp));
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) {
        if (s[i - 1] == t[j - 1]) {
          dp[i][j] = max(dp[i][j], dp[i - 1][j - 1] + 2);
        } else {
          dp[i][j] = max(dp[i][j], max(dp[i - 1][j] - 1, dp[i][j - 1] - 1));
        }
        ans = max(ans, dp[i][j]);
      }
    }
    cout << ans << endl;
  }
  precomputation();
  return 0;
}
