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.util.*;
import java.util.*;
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 Alic {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		String s = sc.next();
		String x = sc.next();

		boolean flag = true;
		int c = 0;
		if (s.charAt(s.length() - 1) != x.charAt(x.length() - 1)) {
			System.out.println(s.length() + x.length());
		} else {

			if (s.length() >= x.length()) {
				int j = x.length() - 1;
				for (int i = s.length() - 1; i >= 0 && j >= 0; i--) {
					if (s.charAt(i) == x.charAt(j)) {
						c++;
						j--;
					} else {
						break;

					}

				}
				System.out.println((s.length() - c) + (x.length() - c));
			} else {
				int j = s.length() - 1;
				for (int i = x.length() - 1; i >= 0 && j >= 0; i--) {
					if (s.charAt(j) == x.charAt(i)) {
						c++;
						j--;
					} else {
						break;

					}
				}
				System.out.println((s.length() - c) + (x.length() - c));

			}
		}

		pw.flush();
		pw.close();

	}

	/**
	 *
	 * Fixed Window Find the max sum subarray of a fixed size K
	 *
	 * Example input: [4, 2, 1, 7, 8, 1, 2, 8, 1, 0]
	 *
	 */
	public static int findMaxSumSubarray(int[] arr, int k) {
		int maxValue = Integer.MIN_VALUE;
		int currentRunningSum = 0;
		for (int i = 0; i < arr.length; i++) {
			currentRunningSum += arr[i];
			if (i >= k - 1) {
				maxValue = Math.max(maxValue, currentRunningSum);
				currentRunningSum -= arr[i - (k - 1)]; // Akher element fl 3 bto3 el K
			}
		}
		return maxValue;
	}

	// Dynamic Window
	public static int smallestSubarray(int targetSum, int[] arr) {
		int minWindowSize = Integer.MAX_VALUE;
		int currentWindowSum = 0;
		int windowStart = 0;
		for (int windowEnd = 0; windowEnd < arr.length; windowEnd++) {
			currentWindowSum += arr[windowEnd];
			while (currentWindowSum >= targetSum) {
				minWindowSize = Math.min(minWindowSize, windowEnd - windowStart + 1);
				currentWindowSum -= arr[windowStart];
				windowStart++;
			}
		}
		return minWindowSize;
	}

	// better solution for less steps
	// public static int dfs(int node) {
	// visited[node] = true;
	// int c = 1;
	// for (int i : adjList[node]) {
	// if (!visited[i]) {
	// c += dfs(i);
	// }
	// }
	// return c;
	// Getting last occur of element
	// public static int binarySearch(int low, int n, int high) {
	// low = 0;
	// high = n - 1;
	// while (low <= high) {
	// int mid = (low + high) / 2;
	// if (x >= a[mid]) {
	// if (x == a[mid]) {
	// ans = mid;
	// }
	// low = mid + 1;
	//
	// } else if (a[mid] > x) {
	// high = mid - 1;
	// }
	// }
	//
	// }
	public static int gcdFast(int x, int y) {
		if (y == 0) {
			return x;
		} else {
			return gcdFast(y, x % y);
		}
	}

	public static class Pair implements Comparable<Pair> {
		int a, b;

		public Pair(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(Pair A) {
			return this.a > A.a ? 1 : -1; // sorting ascending
		}
	}

	public static int findLength(String str, int k) {
		int windowStart = 0, maxLength = -1;
		HashMap<Character, Integer> hs = new HashMap<Character, Integer>();
		for (int windowEnd = 0; windowEnd < str.length(); windowEnd++) {
			char rightChar = str.charAt(windowEnd);
			hs.put(rightChar, hs.getOrDefault(rightChar, 0) + 1); // Increasing its value by 1 and if it have no value
																	// just its zero and add 1
			while (hs.size() > k) {
				char leftChar = str.charAt(windowStart);
				hs.put(leftChar, hs.get(leftChar) - 1);
				if (hs.get(leftChar) == 0) {
					hs.remove(leftChar);
				}
				windowStart++;
			}
			maxLength = Math.max(maxLength, windowEnd - windowStart + 1);
		}
		return maxLength;
	}

	public static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}

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

		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 double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

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

		public int[] nextArr(int n) throws IOException {
			int arr[] = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}
	}
}