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.
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

/**
 * Created by Katushka on 11.03.2020.
 */
public class Main {

    private static final DecimalFormat DF_2 = new DecimalFormat("0.00");

    static int[] readArray(int size, InputReader in) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextInt();
        }
        return a;
    }

    static long[] readLongArray(int size, InputReader in) {
        long[] a = new long[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextLong();
        }
        return a;
    }

    private static final long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
//        InputReader in = new InputReader(new FileInputStream("input.txt"));
//        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream("gangs.out")));

        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();
        int m = in.nextInt();
        String s = in.nextString();
        String t = in.nextString();
        int dp[][] = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (s.charAt(i) == t.charAt(j)) {
                    if (i == 0 || j == 0) {
                        dp[i][j] = 2;
                    } else {
                        dp[i][j] = dp[i - 1][j - 1] + 2;
                    }
                } else {
                    if (i > 0) {
                        dp[i][j] = Math.max(dp[i][j], dp[i - 1][j] - 1);
                    }
                    if (j > 0) {
                        dp[i][j] = Math.max(dp[i][j], dp[i][j - 1] - 1);
                    }
                }
            }
        }
        int max = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                max = Math.max(max, dp[i][j]);
            }
        }
        out.println(max);
        out.close();
    }

    static int binSearchRight(long[][] list, long key) {
        int l = -1;
        int r = list.length;
        while (l < r - 1) {
            int m = (l + r) / 2;
            if (list[m][0] <= key) {
                l = m;
            } else {
                r = m;
            }
        }
        return l;
    }

    private static double scc(Collection<Integer>[] edges, Collection<Integer>[] invEdges) {
        List<Integer> p = new ArrayList<>();
        int n = edges.length;
        boolean[] visited = new boolean[n];

        for (int i = 0; i < n; i++) {
            if (!visited[i]) {
                dfs1(i, edges, p, visited);
            }
        }

        int[] comps = new int[n];
        Arrays.fill(comps, -1);
        int comp = 0;
        Set<Integer>[] compEdges = new HashSet[n];
        Set<Integer>[] invCompEdges = new HashSet[n];

        for (int i = n - 1; i >= 0; i--) {
            if (comps[p.get(i)] == -1) {
                compEdges[comp] = new HashSet<>();
                invCompEdges[comp] = new HashSet<>();
                dfs2(p.get(i), invEdges, comps, comp);
                comp++;
            }
        }

        int m = comp;

        int[] compSizes = new int[m];

        for (int i = 0; i < n; i++) {
            compSizes[comps[i]]++;
            for (int to : edges[i]) {
                if (comps[i] != comps[to]) {
                    compEdges[comps[i]].add(comps[to]);
                    invCompEdges[comps[to]].add(comps[i]);
                }
            }
        }
        Set<Integer> starts = new HashSet<>();
        for (int i = 0; i < m; i++) {
            if (invCompEdges[i].isEmpty()) {
                starts.add(i);
            }
        }

        return bfs(starts, compEdges, m, compSizes, invCompEdges);
    }

    private static double bfs(Set<Integer> start, Set<Integer>[] graph, int n, int[] compSizes, Set<Integer>[] invCompEdges) {
        Queue<Integer> q = new LinkedList<>();
        Set<Integer>[] parents = new Set[n];
        for (int i = 0; i < n; i++) {
            parents[i] = new HashSet<>();
        }
        boolean[] visited = new boolean[n];
        for (Integer v : start) {
            q.add(v);
            visited[v] = true;
            parents[v].add(v);
        }
        double res = start.size();

        while (!q.isEmpty()) {
            int v = q.poll();
            outer:
            for (int to : graph[v]) {
                if (!visited[to]) {
                    for (int p : invCompEdges[to]) {
                        if (parents[p].isEmpty()) {
                            continue outer;
                        }
                    }
                }
                if (!visited[to]) {
                    visited[to] = true;
                    q.add(to);
                    parents[to] = new HashSet<>();
                    parents[to].add(to);
                    for (int p : invCompEdges[to]) {
                        parents[to].addAll(parents[p]);
                    }
                    double sum = 0;
                    for (Integer p : parents[to]) {
                        sum += compSizes[p];
                    }
                    res += compSizes[to] * 1.0 / sum;
                }
            }
        }

        return res;
    }

    private static int dfs2(int v, Collection<Integer>[] invEdges, int[] comps, int comp) {
        if (comps[v] != -1) {
            return 0;
        }
        comps[v] = comp;
        int cnt = 1;
        for (Integer to : invEdges[v]) {
            cnt += dfs2(to, invEdges, comps, comp);
        }
        return cnt;
    }

    private static int dfs1(int v, Collection<Integer>[] edges, List<Integer> p, boolean[] visited) {
        visited[v] = true;
        int cnt = 1;
        for (Integer to : edges[v]) {
            if (!visited[to]) {
                cnt += dfs1(to, edges, p, visited);
            }
        }
        p.add(v);
        return cnt;
    }


    private static void outputArray(List<Long> ans, PrintWriter out) {
        StringBuilder str = new StringBuilder();
        for (long an : ans) {
            str.append(an).append(' ');
        }
        out.println(str);
    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                createTokenizer();
            }
            return tokenizer.nextToken();
        }

        private void createTokenizer() {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public String nextWord() {
            return next();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public int[] nextInts() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                createTokenizer();
            }
            List<Integer> res = new ArrayList<>();
            while (tokenizer.hasMoreElements()) {
                res.add(Integer.parseInt(tokenizer.nextToken()));
            }
            int[] resArray = new int[res.size()];
            for (int i = 0; i < res.size(); i++) {
                resArray[i] = res.get(i);
            }
            return resArray;
        }
    }
}