Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her.

Sergey gives Nastya the word *t* and wants to get the word *p* out of it. Nastya removes letters in a certain order (one after another, in this order strictly), which is specified by permutation of letters' indices of the word *t*: *a*<sub class="lower-index">1</sub>... *a*<sub class="lower-index">|*t*|</sub>. We denote the length of word *x* as |*x*|. Note that after removing one letter, the indices of other letters don't change. For example, if *t* = "nastya" and *a* = [4, 1, 5, 3, 2, 6] then removals make the following sequence of words "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "nastya".

Sergey knows this permutation. His goal is to stop his sister at some point and continue removing by himself to get the word *p*. Since Nastya likes this activity, Sergey wants to stop her as late as possible. Your task is to determine, how many letters Nastya can remove before she will be stopped by Sergey.

It is guaranteed that the word *p* can be obtained by removing the letters from word *t*.
The first and second lines of the input contain the words *t* and *p*, respectively. Words are composed of lowercase letters of the Latin alphabet (1 ≤ |*p*| &lt; |*t*| ≤ 200 000). It is guaranteed that the word *p* can be obtained by removing the letters from word *t*.

Next line contains a permutation *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">|*t*|</sub> of letter indices that specifies the order in which Nastya removes letters of *t* (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ |*t*|, all *a*<sub class="lower-index">*i*</sub> are distinct).
In the first sample test sequence of removing made by Nastya looks like this:

"ababcba" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "ababcba" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "ababcba" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "ababcba" 

Nastya can not continue, because it is impossible to get word "abb" from word "ababcba".

So, Nastya will remove only three letters.
ababcba
abb
5 3 4 1 7 6 2
3
bbbabb
bb
1 6 3 4 2 5
4
cacaccccccacccc
cacc
10 9 14 5 1 7 15 3 6 12 4 8 11 13 2
9
aaaabaaabaabaaaaaaaa
aaaa
18 5 4 6 13 9 1 3 7 8 16 10 12 19 17 15 14 11 20 2
16
aaaaaaaadbaaabbbbbddaaabdadbbbbbdbbabbbabaabdbbdababbbddddbdaabbddbbbbabbbbbabadaadabaaaadbbabbbaddb
aaaaaaaaaaaaaa
61 52 5 43 53 81 7 96 6 9 34 78 79 12 8 63 22 76 18 46 41 56 3 20 57 21 75 73 100 94 35 69 32 4 70 95 88 44 68 10 71 98 23 89 36 62 28 51 24 30 74 55 27 80 38 48 93 1 19 84 13 11 86 60 87 33 39 29 83 91 67 72 54 2 17 85 82 14 15 90 64 50 99 26 66 65 31 49 40 45 77 37 25 42 97 47 58 92 59 16
57
def check(p, t, order, mid):
    active = [True] * len(p)
    for i in range(mid):
        active[order[i] - 1] = False
    i = 0;j = 0
    while i < len(p):
        while i < len(p) and (active[i] == False or p[i] != t[j]):
            i += 1
        if i == len(p):
            return False
        j += 1
        i += 1
        if j == len(t):
            return True
    return False
    
p = input()
t = input()
order = list(map(int, input().split()))
lo = 0; hi = len(p) - len(t) + 1
while lo < hi:
    mid = lo + (hi - lo)//2
    # print(lo, hi, mid)
    if check(p, t, order, mid) and check(p, t, order, mid+1) == False:
        lo = mid
        break
    if check(p, t, order, mid):
        lo = mid
    else:
        hi = mid - 1
    
print(lo)