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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long int inf = 1e18;
long long int expo(long long int x, long long int y) {
  long long int ans = 1;
  while (y != 0) {
    if (y % 2) {
      ans = ans * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return ans;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int max(long long int x, long long int y) {
  if (x > y) return x;
  return y;
}
long long int min(long long int x, long long int y) {
  if (x < y) return x;
  return y;
}
vector<long long int> SieveOfEratosthenes(long long int n) {
  vector<long long int> primes;
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++)
    if (prime[p]) primes.push_back(p);
  return primes;
}
vector<long long int> getDivisors(long long int num) {
  vector<long long int> divisors;
  for (long long int i = 1; i * i <= num; i++) {
    if (!(num % i)) {
      if (i * i == num)
        divisors.push_back(i);
      else {
        divisors.push_back(i);
        divisors.push_back(num / i);
      }
    }
  }
  sort(divisors.begin(), divisors.end());
  return divisors;
}
void displayVector(vector<long long int> vect) {
  for (long long int i = 0; i < vect.size(); i++) cout << vect[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  string t;
  cin >> s;
  cin >> t;
  string bigger;
  string smaller;
  int ans = 0;
  if (s.size() > t.size()) {
    bigger = s;
    smaller = t;
  } else {
    bigger = t;
    smaller = s;
  }
  int smol_pnt = smaller.size() - 1;
  int big_pnt = bigger.size() - 1;
  int till_smol = smaller.size();
  int till_big = bigger.size();
  while (smol_pnt >= 0 && big_pnt >= 0) {
    if (smaller[smol_pnt] == bigger[big_pnt]) {
      till_big = big_pnt;
      till_smol = smol_pnt;
    } else
      break;
    smol_pnt--;
    big_pnt--;
  }
  ans += till_big;
  ans += till_smol;
  cout << ans << endl;
}