There is a sequence of colorful stones. The color of each stone is one of red, green, or blue. You are given a string s. The i-th (1-based) character of s represents the color of the i-th stone. If the character is "R", "G", or "B", the color of the corresponding stone is red, green, or blue, respectively.

Initially Squirrel Liss is standing on the first stone. You perform instructions one or more times.

Each instruction is one of the three types: "RED", "GREEN", or "BLUE". After an instruction c, if Liss is standing on a stone whose colors is c, Liss will move one stone forward, else she will not move.

You are given a string t. The number of instructions is equal to the length of t, and the i-th character of t represents the i-th instruction.

Calculate the final position of Liss (the number of the stone she is going to stand on in the end) after performing all the instructions, and print its 1-based position. It is guaranteed that Liss don't move out of the sequence.


-----Input-----

The input contains two lines. The first line contains the string s (1 ≤ |s| ≤ 50). The second line contains the string t (1 ≤ |t| ≤ 50). The characters of each string will be one of "R", "G", or "B". It is guaranteed that Liss don't move out of the sequence.


-----Output-----

Print the final 1-based position of Liss in a single line.


-----Examples-----
Input
RGB
RRR

Output
2

Input
RRRBGBRBBB
BBBRR

Output
3

Input
BRRBGBRGRBGRGRRGGBGBGBRGBRGRGGGRBRRRBRBBBGRRRGGBBB
BBRBGGRGRGBBBRBGRBRBBBBRBRRRBGBBGBBRRBBGGRBRRBRGRB

Output
15

Difficulty: interview

Starter code:

Solutions:
#scott http://codeforces.com/problemset/problem/265/A new problem

RO = input() # darn i don't know how to read string
ins = input() #scott
n = 0


for x in range (len(ins)): #scott yeah that looks fine
    #print (x)
    if ins[x] == RO[n]:
        n += 1 #scott

print(n+1)


a = input()
b = input()
pos = 0
for i in b:
  if a[pos] == i: pos += 1
print(pos + 1)


S=input()
t=input()
ind=0
for i in range(len(t)):
    if(t[i]==S[ind]):
        ind+=1

print(ind+1)


import sys
my_file = sys.stdin
#my_file = open("input.txt", "r")
s = my_file.readline()
t = my_file.readline()
res = 1
for char in t:
    if char == s[0]:
        res += 1
        s = s[1:]
print(res)

a, b = input(), input()
i, j = 0, 0
while True:
    while j < len(b) and a[i] != b[j]: j += 1
    if j == len(b): break
    i += 1
    j += 1
print(i + 1)

line = input()
commands = input()

current = line[0]
j = 0
for i in commands:
    if i == line[j]:
        j += 1

print(j+1)


a = input()
b = input()
i = 0
for c in b:
    if a[i] == c: i += 1
print(i+1)



c,s,i=0,input(),input()
for j in i:
    if j==s[c]:
        c+=1
print(c+1)

c,s,i=0,input(),input()
for j in i:
    if j==s[c]:c+=1
print(c+1)

s = input()
c = input()
step = 0
for i in range(len(c)):
    if c[i] == s[step]:
        step += 1
print(step+1)


__copyright__ = ''
__author__ = 'Son-Huy TRAN'
__email__ = "sonhuytran@gmail.com"
__doc__ = ''
__version__ = '1.0'


def main() -> int:
    (s, t) = input(), input()
    i = 0

    for instruction in t:
        if instruction == s[i]:
            i += 1

    print(i + 1)
    return 0


def __starting_point():
    exit(main())
__starting_point()

s = str(input())
t = str(input())
idx = 0
ans = s[idx]
for i in range(len(t)):
    if (ans == t[i]):
        idx += 1
        ans = s[idx]
print(idx + 1)

str1=input()
str2=input()
cpos=0

for i in str2:
    if i==str1[cpos]:
        cpos+=1
        
print(cpos+1)

import sys
import math

s = (sys.stdin.readline())
t = (sys.stdin.readline())

sl = len(s) - 1
tl = len(t) - 1

j = 0

res = 1
for i in range(tl):
    if(s[j] == t[i]):
        res += 1
        j += 1
        
print(res)

s = input()
t = input()
res = 0
for x in t:
	if s[res] == x:
		res += 1
print(res + 1)


def main():
    way = input()
    i = 0
    for c in input():
        if c == way[i]:
            i += 1
    print(i + 1)


def __starting_point():
    main()
__starting_point()

s=input()
c=input()
i=0
while s[i] in c:
    c=c[c.index(s[i])+1:]
    i+=1
print(i+1)


a=input()
b=input()
j=0
s=1

for i in range(len(b)):
    if b[i]==a[j]:
        s=s+1
        j=j+1

print(s)

# coding: utf-8
s = input()
t = input()
pos = 0
for i in t:
    if i == s[pos]:
        pos += 1
print(pos+1)


data = input()
instruction = input()
position = 1
for instruct in instruction:
    if(data[position-1] == instruct):
        position += 1
print(position)


data = input()
instruction = input()
position = 1
for instruct in instruction:
    if(data[position-1] == instruct):
        position += 1
print(position)



a=input()
b=input()
i=0
while b:
    if b[0]==a[i]:i+=1
    b=b[1:]
print(i+1)


stones = input()
moves=  input()

index=0
for i in moves:
    if i ==stones[index]:
        index+=1
print(index+1)
        



road = input()
t = input()
cur = 0
for i in range(len(t)):
    if road[cur] == t[i]:
        cur += 1
print(cur+1)

pole = input()
commands = input()

curX = 0
for c in commands:
   if (c == pole[curX]):
      curX += 1
print(curX + 1)