Problem: You are given two strings s and t. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by 1. You can't choose a string if it is empty.

For example:

  * by applying a move to the string "where", the result is the string "here", 
  * by applying a move to the string "a", the result is an empty string "". 



You are required to make two given strings equal using the fewest number of moves. It is possible that, in the end, both strings will be equal to the empty string, and so, are equal to each other. In this case, the answer is obviously the sum of the lengths of the initial strings.

Write a program that finds the minimum number of moves to make two given strings s and t equal.

Input

The first line of the input contains s. In the second line of the input contains t. Both strings consist only of lowercase Latin letters. The number of letters in each string is between 1 and 2⋅10^5, inclusive.

Output

Output the fewest number of moves required. It is possible that, in the end, both strings will be equal to the empty string, and so, are equal to each other. In this case, the answer is obviously the sum of the lengths of the given strings.

Examples

Input

test
west


Output

2


Input

codeforces
yes


Output

9


Input

test
yes


Output

7


Input

b
ab


Output

1

Note

In the first example, you should apply the move once to the first string and apply the move once to the second string. As a result, both strings will be equal to "est".

In the second example, the move should be applied to the string "codeforces" 8 times. As a result, the string becomes "codeforces" → "es". The move should be applied to the string "yes" once. The result is the same string "yes" → "es".

In the third example, you can make the strings equal only by completely deleting them. That is, in the end, both strings will be empty.

In the fourth example, the first character of the second string should be deleted.

Solution (in JAVA):

Solution:

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Test {

    static long[] a = {47, 74, 4477, 4747, 4774, 7447, 7474, 7744, 444777, 447477, 447747, 447774, 474477, 474747, 474774, 477447, 477474, 477744, 744477,
        744747, 744774, 747447, 747474, 747744, 774447, 774474, 774744, 777444, 44447777, 44474777, 44477477, 44477747, 44477774, 44744777,
        44747477, 44747747, 44747774, 44774477, 44774747, 44774774, 44777447, 44777474, 44777744, 47444777, 47447477, 47447747, 47447774,
        47474477, 47474747, 47474774, 47477447, 47477474, 47477744, 47744477, 47744747, 47744774, 47747447, 47747474, 47747744,
        47774447, 47774474, 47774744, 47777444, 74444777, 74447477, 74447747, 74447774, 74474477, 74474747, 74474774, 74477447,
        74477474, 74477744, 74744477, 74744747, 74744774, 74747447, 74747474, 74747744, 74774447, 74774474, 74774744, 74777444,
        77444477, 77444747, 77444774, 77447447, 77447474, 77447744, 77474447, 77474474, 77474744, 77477444, 77744447, 77744474,
        77744744, 77747444, 77774444, 4444477777L};

    static int Last_Ocuu(int n, int s) {
        int start = 0, end = s - 1, mid, ans = -1;
        while (start <= end) {
            mid = (start + end) >> 1;
            if (a[mid] == n) {
                return mid;
            } else if (a[mid] > n) {
                ans = mid;
                end = mid - 1;
            } else {
                start = mid + 1;
            }
        }
        return ans;
    }

    static boolean isvo(char s) {
        return (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u' || s == 'n');
    }

    public static void main(String[] args) throws FileNotFoundException, IOException {
        Scannerr in = new Scannerr(System.in);
        try (PrintWriter or = new PrintWriter(System.out)) {
            char[] s = in.nextLine().toCharArray();
            char[] t = in.nextLine().toCharArray();
             int inds = 0, indt = 0, ls = s.length, lt = t.length;
             long ans=ls+lt;
             for (int i = 0; i <lt&&i<ls; i++) {
                if(s[ls-i-1]==t[lt-i-1])ans-=2;
                else break;
            }
           or.print(ans);
        }

    }

    static class Scannerr {

        StringTokenizer st;
        BufferedReader br;

        public Scannerr(FileReader fileReader) throws FileNotFoundException {
            br = new BufferedReader(fileReader);
        }

        public Scannerr(InputStream s) throws FileNotFoundException {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }

}

class Pairr {

    int value;
    int index;

    // int min;
    public Pairr(int value, int index) {
        this.value = value;
        this.index = index;
        //min = m;
    }

}