n, k = list(map(int,input().split(' ')))
q = sorted(list(map(int, input().split(' '))))
result = 0
if k >= q[-1]/2:
    print(result)
else:
    for i in q:
        if i <= k:
            pass
        elif i <= 2*k:
            k = i
            pass
        else:
            result += 1
            k *= 2
    print(result)


n, k = list(map(int,input().split(' ')))
q = sorted(list(map(int, input().split(' '))))
result = 0
if k >= q[-1]/2:
    print(result)
else:
    for i in q:
        if k >= q[-1]/2:
            break
        if i <= k:
            pass
        elif i <= 2*k:
            k = i
            pass
        else:
            while k*2 < i:
                result += 1
                k *= 2
    print(result)


n, k = list(map(int,input().split(' ')))
q = sorted(list(map(int, input().split(' '))))
result = 0
if k > q[-1]:
    print(result)
else:
    for i in q:
        if i < k:
            pass
        elif i <= 2*k:
            k = i
            pass
        else:
            result += 1
            k *= 2
    print(result)


def list_input():
    return list(map(int,input().split()))
def map_input():
    return map(int,input().split())
def map_string():
    return input().split()

def dist(a,b,k):
    a = max(a,k)
    a *= 2
    cnt = 0
    while a < b:
        a *= 2
        cnt += 1
    return cnt

n,k = map_input()
a = list_input()
a.sort()
ans = dist(k,a[0],k)
for i in range(1,n):
    ans += dist(a[i-1],a[i],k)

print(ans)


def list_input():
    return list(map(int,input().split()))
def map_input():
    return map(int,input().split())
def map_string():
    return input().split()

n,k = map_input()
a = list_input()
m = max(a)
ans = 0
while k <= m:
    k *= 2
    ans += 1
print(ans-1)


n,k = map(int,input().split())
a = max(list(map(int,input().split())))
ans =0
k *=2
while k<a:
    ans += 1
    k *= 2
print(ans)


def list_input():
    return list(map(int,input().split()))
def map_input():
    return map(int,input().split())
def map_string():
    return input().split()

def dist(a,b,k):
    a = max(a,k)
    a *= 2
    cnt = 0
    while a < b:
        a *= 2
        cnt += 1
    return cnt

n,k = map_input()
a = list_input()
ans = dist(k,a[0],k)
a.sort()
for i in range(1,n):
    ans += dist(a[i-1],a[i],k)

print(ans)


def list_input():
    return list(map(int,input().split()))
def map_input():
    return map(int,input().split())
def map_string():
    return input().split()

def dist(a,b,k):
    a = max(a,k)
    a *= 2
    cnt = 0
    while a < b:
        a *= 2
        cnt += 1
    return cnt

n,k = map_input()
a = list_input()
ans = 0
a.sort()
for i in range(1,n):
    ans += dist(a[i-1],a[i],k)

print(ans)


n,k = [int(a) for a in input().split()]

ar = [int(a) for a in input().split()]

ar.sort()
ct = 0
i = 0

while i < n:
    if ar[i] > k:
        if ar[i] > 2*k:
            k *= 2
            ct += 1
        else:
            k = ar[i]
            i += 1
    else:
        i += 1

print(ct)


def judge():
    count = 0
    S = input()
    T = input()
    sList = S.split()
    sList = [int(i) for i in sList]
    tList = T.split()
    n = sList[0]
    k = sList[1]
    tList = [int(i) for i in tList]
    uList = sorted(tList)
    for num in uList:
        if (2*k >= num):
            if (k<num):
                k = num
            pass
        else:
            while True:
                k = 2*k
                count += 1
                if (2*k >= num):
                    if (k < num):
                        k = num
                    break
    print(count)

judge()


def judge():
    count = 0
    S = input()
    T = input()
    sList = S.split()
    sList = [int(i) for i in sList]
    tList = T.split()
    n = sList[0]
    k = sList[1]
    tList = [int(i) for i in tList]
    uList = sorted(tList)
    for num in uList:
        if (2*k >= num):
            pass
        else:
            while True:
                k = 2*k
                count += 1
                if (2*k >= num):
                    break
    print(count)

judge()


def judge():
    count = 0
    S = input()
    T = input()
    sList = S.split()
    sList = [int(i) for i in sList]
    tList = T.split()
    n = sList[0]
    k = sList[1]
    tList = [int(i) for i in tList]
    uList = sorted(tList)
    print(uList)
    for num in uList:
        if (2*k >= num):
            if (k<num):
                k = num
            pass
        else:
            while True:
                k = 2*k
                count += 1
                if (2*k >= num):
                    break
    print(count)

judge()


def judge():
    count = 0
    S = input()
    T = input()
    sList = S.split()
    sList = [int(i) for i in sList]
    tList = T.split()
    n = sList[0]
    k = sList[1]
    tList = [int(i) for i in tList]
    uList = sorted(tList)
    for num in uList:
        if (2*k >= num):
            if (k<num):
                k = num
            pass
        else:
            while True:
                k = 2*k
                count += 1
                if (2*k >= num):
                    break
    print(count)

judge()


n,k = map(int,input().split())

dif = list(map(int,input().split()))

c = 0

for elem in dif:
    if elem>k*2:
        for elem1 in dif:
            if elem1*2>=elem and elem1!=elem:
                break
            elif elem1==dif[n-1]:
                c+=1
                break

print(c)


n,k = map(int,input().split())

dif = list(map(int,input().split()))

c = 0
mx = 0

for elem in dif:
    if elem>k*2 and elem>mx*2:
        c+=1
        break
    if elem>mx: mx = elem

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    while a[i]>k:
        c+=1
        k *= 2
    k = max(k//2,a[i])

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    while a[i]>k:
        c+=1
        k *= 2

print(c)


n,k = map(int,input().split())

dif = list(map(int,input().split()))

c = 0
mx = 0
dif = sorted(dif)
dif.reverse()

for elem in dif:
    if elem>k*2 and elem>mx*2:
        c+=1
        break
    if elem>mx: mx = elem

print(c)


n,k = map(int,input().split())

dif = list(map(int,input().split()))

c = 0
mx = 0
dif = sorted(dif)
dif.reverse()

for elem in dif:
    if elem/2>k and elem/2>mx:
        c+=1
        break
    if elem>mx: mx = elem

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    if a[i]>k:
        c+=1
        k = a[i]*2

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    if a[i]>k:
        c+=1
        k = a[i]*2
    if a[i]>k//2: k = a[i]*2

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    while a[i]>k:
        c+=1
        k *= 2
    k = 2*max(k//2,a[i])

print(c)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    while a[i]>k:
        c+=1
        k *= 2
    k = max(k//1,a[i])

print(c)


n,m = map(int,input().split())
d = list(map(int,input().split()))
k = [0]*n
s = 0

for i in range(n):
    if d[i]<=m*2:
        k[i] = 1
    else:
        p = 1
        for j in range(n):
            if d[i]<=d[j]*2 and k[j]==1:
                p = 0
        s+=p

print(s)


n,k = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a)

k*=2
c = 0

for i in range(n):
    if a[i]>k:
        while k<a[i]:
            c+=1
            k *= 2
    k = 2*max(k,a[i])

print(c)


n,m = map(int,input().split())
d = list(map(int,input().split()))
k = [0]*n
s = 0

for i in range(n):
    if d[i]<=m*2:
        k[i] = 1
    else:
        p = 1
        for j in range(n):
            if d[i]<=d[j]*2 and k[j]==1:
                p = 0
                k[i] = 1
        s+=p

print(s)


n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

result = 0

for d in a:
	while d > 2*k:
		k *= 2
		result += 1
	k = max(d, k)

print(result)


n, mx = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()
cntr = i = 0
while i < n:
    if mx >= a[i] / 2:
        mx = max(mx, a[i])
        i += 1
    else:
        mx *= 2
        cntr += 1
print(cntr)


n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
lvl = k * 2
cnt = 0
for i in range(n):
    while lvl < a[i]:
        lvl *= 2
        cnt += 1
    if lvl < a[i] * 2:
        lvl = a[i] * 2
print(cnt)


n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
lvl = k * 2
cnt = 0
for i in range(n):
    while lvl < a[i]:
        lvl *= 2
        cnt += 1
print(cnt)


n, k = map(int, input().split())
a = sorted([int(x) for x in input().split()])
ans = 0

for i in range(0, n):
    while k * 2 < a[i]:
        ans += 1
        k *= 2
    k = max(k, a[i])

print(ans)


s = input().split(' ')
n = int(s[0])
k = int(s[1])
s = input().split(' ')
arr = []
for a in s:
    arr.append(int(a))

arr.sort()
tot = 0
for i in range(0, n):
    while 2 * k < arr[i]:
        k *= 2
        tot+=1
    k = max(k, arr[i])
print(tot)


import sys

n, max_solvable = [int(i) for i in sys.stdin.readline().split()]
dif = [int(i) for i in sys.stdin.readline().split()]
dif.sort()

max_solvable = max_solvable * 2

i = 0
ans = 0

while(True):
	while i < len(dif) and max_solvable >= dif[i]:
		max_solvable = max(max_solvable, dif[i] * 2)
		i += 1
	if i == len(dif):
		break
	ans += 1
	max_solvable *= 2

print(ans)


n, k = map(int, input().split(' '))
problems = list(map(int, input().split(' ')))

problems.sort()
# easy = []

# for i in range(len(problems)):
# 	if problems[i] > k:
# 		problems = problems[i:]
# 		break

max_solved = k
problem_index = 0
n_has_to_solve = 0

while problem_index < n:
	if problems[problem_index] <= max_solved * 2:
		max_solved = max(max_solved, problems[problem_index])
		problem_index += 1
	else:
		max_solved *= 2
		n_has_to_solve += 1

print(n_has_to_solve)


n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(n):
	if (k * 2 >= a[i]):
		k = max(k, a[i])
	else:
		while(k * 2 < a[i]):
			k *= 2
			c += 1
		k = max(k, a[i])
print (c)


n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(n):
	if (k * 2 >= a[i]):
		k = max(k, a[i])
	else:
		while(k * 2 < a[i]):
			k *= 2
			c += 1

print (c)


n,k = [int(i) for i in input().split()]
a = sorted(int(i) for i in input().split())
ans=0
for i in range(n):
	while a[i]/2 > k:
		k*=2
		ans+=1
	k=max(k,a[i])
print(ans)


n, k = map(int, input().split())
a = list(sorted(map(int, input().split())))
ans = 0

for el in a:
    while k * 2 < el:
        k *= 2
        ans += 1
    k = el

print(ans)


n, k = map(int, input().split())
a = list(sorted(map(int, input().split())))
ans = 0

for el in a:
    while k * 2 < el:
        k *= 2
        ans += 1
    k = max(k, el)

print(ans)


n, k = map(int, input().split())
a = list(sorted(map(int, input().split())))
ans = 0

for el in a:
    while k * 2 < el:
        k *= 2
        ans += 1

print(ans)


n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
a.sort()
ct = 0

for p in a:
    while k * 2 < p:
        k *= 2
        ct += 1

print(ct)


n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
a.sort()
ct = 0

for p in a:
    while k * 2 < p:
        k *= 2
        ct += 1
    k = max(k,p)

print(ct)


n_k = [int(x) for x in input().split()]

high = n_k[1] * 2

problems = [int(x) for x in input().split()]

problems.sort()

count = 0

if problems[-1] <= high:
    print(0)
else:
    for i in range(n_k[0]):
        if problems[i] > high:
            while problems[i] > high:
                count += 1
                high *= 2
    print(count)


n_k = [int(x) for x in input().split()]

high = n_k[1] * 2

problems = [int(x) for x in input().split()]

problems.sort()

count = 0

if problems[-1] <= high:
    print(0)
else:
    for i in range(n_k[0]):
        if problems[i] > high:
            while problems[i] > high:
                count += 1
                high *= 4
                temp_high = problems[i] * 2
                if temp_high > high:
                    high = temp_high
                if problems[-1] <= high:
                    break
        else:
            temp_high = problems[i] * 2
            if temp_high > high:
                high = temp_high
            if problems[-1] <= high:
                    break
    print(count)


n_k = [int(x) for x in input().split()]

high = n_k[1] * 2

problems = [int(x) for x in input().split()]

problems.sort()

count = 0

if problems[-1] <= high:
    print(0)
else:
    for i in range(n_k[0]):
        if problems[i] > high:
            while problems[i] > high:
                count += 1
                high *= 2
        else:
            temp_high = problems[i] * 2
            if temp_high > high:
                high = temp_high
    print(count)


n_k = [int(x) for x in input().split()]

high = n_k[1] * 2

problems = [int(x) for x in input().split()]

problems.sort()

count = 0

if problems[-1] <= high:
    print(0)
else:
    for i in range(n_k[0]):
        if problems[i] > high:
            while problems[i] > high:
                count += 1
                high *= 2
            temp_high = problems[i] * 2
            if temp_high > high:
                 high = temp_high
        else:
            temp_high = problems[i] * 2
            if temp_high > high:
                high = temp_high
        if problems[-1] <= high:
            break
    print(count)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

n, k = mints()
a = list(mints())
a.sort()
r = 0
for i in range(n):
	if a[i] > k:
		while k*2 < a[i]:
			r += 1
			k *= 2
		k = a[i]
print(r)


n,d=map(int,input().split())
s=list(map(int,input().split()))
k=0
for i in range(n):
    m=min(s)
    if m/2>d:
        while m/2>d:
            k+=1
            d*=2
    s.remove(m)
print(k)


n,d=map(int,input().split())
s=list(map(int,input().split()))
k=0
for i in range(n):
    m=min(s)
    if m/2>d:
        while m/2>d:
            k+=1
            d*=2
    if d<m:
        d=m
    s.remove(m)
print(k)


n,k=map(int, input().split())
a=sorted(list(map(int,input().split())))
ans=0
for x in a:
    while x>k*2:
        k*=2
        ans+=1
    k=max(x,k)
print(ans)


n, k = map(int, input().split())
a = sorted(map(int, input().split()))
t = 0
x = 0
while max(a) > 2*k:
  while a[x] <= 2*k:
    x += 1
  if x > 0:
    k = max(k, a[x-1])
  while 2*k < a[x]:
    k *= 2
    t += 1
print(t)


n, k = map(int, input().split())
a = sorted(map(int, input().split()))
t = 0
x = 0
while max(a) > 2*k:
  while a[x] <= 2*k:
    x += 1
  while 2*k < a[x]:
    k *= 2
    t += 1
print(t)


n, k = map(int, input().split())
difficulties = map(int, input().split())

maxDif = k

difficulties = sorted(difficulties)

other = 0

for index, item in enumerate(difficulties):
    while maxDif * 2 < item:
        maxDif *= 2
        other += 1

    if maxDif < item:
        maxDif = item

print(other)


n, k = map(int, input().split())
difficulties = map(int, input().split())

maxDif = k

difficulties = sorted(difficulties)

other = 0

for index, item in enumerate(difficulties):
    if index == 0:
        continue

    while maxDif * 2 < item:
        maxDif *= 2
        other += 1

    if maxDif < item:
        maxDif = item

print(other)


R=lambda:list(map(int,input().split()))
n,k=R()
a=sorted(R())
b=0
for i in a:
  while i>k+k:
    k+=k
    b+=1
  k=max(k,i)
print(b)


#!/usr/bin/env python3
def solve():
    n, k = get([int])
    k = 2 * k
    A = sorted(get([int]))

    c = 0
    for a in A:
        while a > k:
            c += 1
            k *= 2
        k = max(k, 2 * a)

    return c

_testcases = """
3 3
2 1 9

1

4 20
10 3 6 3

0

""".strip()

# ======================= B O I L E R P L A T E ======================= #
# Practicality beats purity

import re
import sys
import math
import heapq
from heapq import heapify, heappop, heappush
import bisect
from bisect import bisect_left, bisect_right
import operator
from operator import itemgetter, attrgetter
import itertools
import collections

inf = float('inf')
sys.setrecursionlimit(10000)

def tree():
    return collections.defaultdict(tree)

def cache(func):  # Decorator for memoizing a function
    cache_dict = {}

    def _cached_func(*args, _get_cache=False):
        if _get_cache:
            return cache_dict
        if args in cache_dict:
            return cache_dict[args]
        cache_dict[args] = func(*args)
        return cache_dict[args]
    return _cached_func

def equal(x, y, epsilon=1e-6):
    # https://code.google.com/codejam/kickstart/resources/faq#real-number-behavior
    if -epsilon <= x - y <= epsilon:
        return True
    if -epsilon <= x <= epsilon or -epsilon <= y <= epsilon:
        return False
    return (-epsilon <= (x - y) / x <= epsilon or -epsilon <= (x - y) / y <= epsilon)

def get(_type):  # For easy input
    if type(_type) == list:
        if len(_type) == 1:
            _type = _type[0]
            return list(map(_type, input().strip().split()))
        else:
            return [_type[i](inp) for i, inp in enumerate(input().strip().split())]
    else:
        return _type(input().strip())

if __name__ == '__main__':
    print(solve())


read = lambda: map(int, input().split())
n, k = read()
a = sorted(read())
res = 0
for i in a:
    while 2*k < i:
        k *= 2
        res += 1
    k = max(k, i)
print(res)


read = lambda: map(int, input().split())
n, k = read()
a = sorted(read())
res = 0
for i in a:
    if 2*k >= i > k:
        k = i
    while 2*k < i:
        k *= 2
        res += 1
print(res)


n, k = map(int, input().split())
a = sorted(map(int, input().split()))

ans = 0
from math import log

for i in a:
	if k * 2 >= i:
		k = max(k, i)
	else:
		while k * 2 < i:
			k *= 2
			ans += 1
		k = max(k, i)

print(ans)


n, k = map(int, input().split())
s = sorted(tuple(map(int, input().split())))
max = k
ans = 0
for a in s:
    if a > max:
        while max < a / 2:
            max = max * 2
            ans = ans + 1
        max = a
print(ans)


import math
n, k = [int(x) for x in input().split()]
pr = [int(x) for x in input().split()]
pr.sort()
count = 0
for i in pr:
    if i > k:
        if math.ceil(i / 2) <= k:
            k = i
        else:
            ct = i
            while True:
                ct = math.ceil(ct / 2)
                count += 1
                if math.ceil(ct / 2) <= k:
                    break
            k = i
print(count)


import math
def main():
    n, k = map(int, input().split())
    P = list(map(int, input().split()))
    P.sort()

    M = k
    count = 0
    for num in P:
        f = math.ceil(math.log2(num/M)) - 1
        # print(num/M, f)
        if f < 1:
            pass
        else:
            count += f
        M = max(M, num)
    print(count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()


n,k=map(int,input().split())
x=0
for d in sorted(map(int,input().split())):
    while 2*k<d:
        k*=2
        x+=1
    k=max(k,d)
print(x)


n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
c=0
for i in range(n):
    while k*2<a[i]:
        k=k*2
        c+=1
    k=max(k,a[i])
print(c)


n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
c=0
for i in range(n):
    if k*2>=a[i]:
        k=max(k,a[i])
    else:
        while k*2<a[i]:
            k=k*2
            c+=1
        k=max(k,a[i])
print(c)


n,k=map(int,input().split())
l=sorted(map(int,input().split()))
ans=int(0)
for i in l:
    while k*2<i:
        k*=2
        ans+=1
    k=max(k,i)
print(ans)


ans = 0
n, k = map(int, input().split())
d = 2 * k
arr = input()
l = list(map(int, arr.split(' ')))
l = sorted(l)
for i in l:
    if d >= i:
        d = 2 * max(k, i)
    else:
        while d < i:
            d *= 2
            ans += 1
        d = max(d, 2 * i)
print(ans)


n, k = map(int, input().split())
tasks = sorted(filter(lambda x: x > k, set(map(int, input().split()))))
res = 0

for task in tasks:
    while (k << 1) < task:
        k <<= 1
        res += 1
    k = task

print(res)


n, k = map(int, input().split())
tasks = filter(lambda x: x > k, set(sorted(map(int, input().split()))))
res = 0

for task in tasks:
    if (k << 1) < task:
        res += 1
        k <<= 1

print(res)


n, k = map(int, input().split())
tasks = filter(lambda x: x > k, set(sorted(map(int, input().split()))))
res = 0

for task in tasks:
    while (k << 1) < task:
        res += 1
        k <<= 1

print(res)


import collections
d=collections.deque()
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
x=0
for i in a:
    d.append(i)
while len(d)>0:
    while len(d)>0 and d[0]<=2*k:
        k=max(k,d.popleft())
    k=2*k
    x+=1
print(x-1)


from math import ceil, log
n, IQ = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    if a[i] > IQ * 2:
#        print(a[i], IQ, ans)
        x = ceil(log(a[i]/2/IQ, 2))
        IQ = IQ * 2**x
        ans += x
#        print(a[i], IQ, ans)
    IQ = max(IQ, a[i])
#    print(IQ)
#    print()
print(ans)


from math import ceil
n, IQ = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    if a[i] > IQ * 2:
#        print(a[i], IQ, ans)
        x = ceil(a[i] / IQ / 2)
        IQ = IQ * 2**(x-1)
        ans += x-1
#        print(a[i], IQ, ans)
    IQ = max(IQ, a[i])
#    print(IQ)
#    print()
print(ans)


n_k = [int(x) for x in input().split()]

high = n_k[1] * 2

problems = [int(x) for x in input().split()]

problems.sort()

count = 0

if problems[-1] <= high:
    print(0)
else:
    for i in range(n_k[0]):
        if problems[i] > high:
            while problems[i] > high:
                count += 1
                high *= 2
            temp_high = problems[i] * 2
            if temp_high > high:
                 high = temp_high
        else:
            temp_high = problems[i] * 2
            if temp_high > high:
                high = temp_high
        if problems[-1] <= high:
            break
    print(count)


n,k=map(int,input().split())
ar=sorted(list(map(int,input().split())))
ans=0
for x in ar:
    while x/2 > k:
        ans+=1
        k*=2

print(ans)


n,k=map(int,input().split())
ar=sorted(list(map(int,input().split())))
ans=0
for x in ar:
    if k <= x <= k*2: k=x
    while x/2 > k:
        ans+=1
        k*=2
    if k <= x <= k*2: k=x
print(ans)


n,k=map(int,input().split())
ar=sorted(list(map(int,input().split())))
ans=0
for x in ar:
    if k <= x <= k*2: k=x
    while x/2 > k:
        ans+=1
        k*=2

print(ans)


import math

I = lambda: map(int, input().split())
n, k = I()
a = list(I())
# print(a)
ans = 0
for task in sorted(a):
    if math.ceil(task/2) <= k:
        k = max(task, k)
        continue
    else:
        ans += 1
        k *= 2

print(ans)


import math

I = lambda: map(int, input().split())
n, k = I()
a = list(I())
# print(a)
ans = 0
for task in sorted(a):
    if math.ceil(task/2) <= k:
        k = max(task, k)
        continue
    else:
        while not math.ceil(task/2) <= k:
            ans += 1
            k *= 2
        k = task

print(ans)


from sys import stdin, stdout
EPS = 10 ** (-20)
INF = float('inf')
size = 10 ** 6

n, k = map(int, stdin.readline().split())
values = sorted(list(map(int, stdin.readline().split())))
i = 0
ans = 0

while i < n:
    if 2 * k >= values[i]:
        k = max(k, values[i])
        i += 1
    else:
        k *= 2
        ans += 1

stdout.write(str(ans))


n, k = map(int, input().split())

l = sorted([int(x) for x in input().split()])

ans = 0

for i in range(len(l)):
        while 2 * k < l[i]:
                        ans += 1
                        k *= 2
        k = max(k, l[i])

print(ans)


n, k = map(int, input().split())

l = sorted([int(x) for x in input().split()])

ans = 0

for i in range(len(l)):
        if 2 * k >= l[i]:
                k = max(k, l[i])
        else:
                while 2 * k < l[i]:
                        ans += 1
                        k *= 2

print(ans)


n,k=map(int,input().split())
a=[int(c) for c in input().split()]
a.sort()
i=0
res=0
while i<n:
    if k>=a[i]//2:
        i+=1
    else:
        k*=2
        res+=1
print(res)


n,k=map(int,input().split())
a=[int(c) for c in input().split()]
a.sort()
i=0
res=0
while i<n:
    if k>=a[i]/2:
        k=max(a[i],k)
        i+=1
    else:
        k*=2
        res+=1
print(res)


n,k=map(int,input().split())
a=[int(c) for c in input().split()]
a.sort()
i=0
res=0
while i<n:
    if k>=a[i]/2:
        i+=1
    else:
        k*=2
        res+=1
print(res)


n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))
answer = 0
for elem in a:
    while 2 * k < elem:
        k *= 2
        answer += 1
    k = max(k, elem)
print(answer)


n, k = map(int, input().split())
a = list(map(int, input().split()))
while True:
    todo = list(filter(lambda x: x > k * 2, a))
    hardest = max(todo, default=0)
    rest = [elem for elem in a if elem not in todo]
    solved = max(rest, default = 0)
    k = max(k, solved)
    if k >= (hardest + 1) // 2:
        break
    answer += 1
    k *= 2
    a = todo
print(answer)


n, k = map(int, input().split())
a = list(map(int, input().split()))
todo = list(filter(lambda x: x > k * 2, a))
hardest = max(todo, default = 0)
rest = [elem for elem in a if elem not in todo]
solved = max(rest, default = 0)
solved = max(solved, k)
answer = 0
while solved < (hardest + 1) // 2:
    solved *= 2
    answer += 1
print(answer)


n, k = map(int, input().split())
a = list(map(int, input().split()))
answer = 0
while True:
    todo = list(filter(lambda x: x > k * 2, a))
    hardest = max(todo, default=0)
    rest = [elem for elem in a if elem not in todo]
    solved = max(rest, default = 0)
    k = max(k, solved)
    if k >= (hardest + 1) // 2:
        break
    answer += 1
    k *= 2
    a = todo
print(answer)


n, k = map(int, input().split())
a = list(map(int, input().split()))
todo = list(filter(lambda x: x > k * 2, a))
todo.sort(reverse = True)
hardest = max(todo, default = 0)
rest = [elem for elem in a if elem not in todo]
solved = max(rest, default = 0)
solved = max(solved, k)
answer = 0

while solved < (hardest + 1) // 2:
    solved *= 2
    answer += 1
    todo = list(filter(lambda x: x > solved * 2, todo))
    hardest = max(todo, default = 0)
print(answer)


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MottoX
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        int get(char ch) {
            if (Character.isDigit(ch)) {
                return ch - '0';
            }
            if (Character.isLowerCase(ch)) {
                return 36 + ch - 'a';
            }
            if (Character.isUpperCase(ch)) {
                return 10 + ch - 'A';
            }
            if (ch == '-') {
                return 62;
            }
            return 63;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String s = in.next();
            long ret = 1, mod = (long) 1e9 + 7;
            for (int i = 0; i < s.length(); i++) {
                int num = get(s.charAt(i));
                int cnt = Integer.bitCount(num ^ 63);
                for (int j = 0; j < cnt; j++) {
                    ret = ret * 3 % mod;
                }
            }
            out.println(ret);
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}


//package yr16.m6.codeForces.div355;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by cscvenkatmadurai on 6/1/2016.
 */
public class VanyaAndLabel {
    public static int mapper(char c){

        if(c == '-'){
            return 62;
        }else if(c == '_'){
            return 63;
        }else if( '0'<=c && c<='9' ){

            return c-'0';
        }else if('a'<=c && c<='z'){

            return c-'a'+36;
        }else {

            return c-'A'+10;
        }
    }

    static int findNoOfZero(String x){
        int count = 0;
        for (int i = 0; i < x.length(); i++) {
            if(x.charAt(i)=='0'){
                count++;
            }
        }
        return count+(6-x.length());
    }

    public static void main(String[] args) throws IOException{
        BufferedReader kb = new BufferedReader(new InputStreamReader(System.in));
        String ip = kb.readLine();
        long ans = 1;
        for (int i = 0; i < ip.length(); i++) {
            ans *= Math.pow(3,findNoOfZero(Integer.toBinaryString(mapper(ip.charAt(i) ))));
            ans %=1000000007;
        }
        System.out.println(ans );

    }
}


//package yr16.m6.codeForces.div355;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by cscvenkatmadurai on 6/1/2016.
 */
public class VanyaAndLabel {
    public static int mapper(char c){

        if(c == '-'){
            return 62;
        }else if(c == '_'){
            return 63;
        }else if( '0'<=c && c<='9' ){

            return c-'0';
        }else if('a'<=c && c<='z'){

            return c-'a'+36;
        }else {

            return c-'A'+10;
        }
    }

    static int findNoOfZero(String x){
        int count = 0;
        for (int i = 0; i < x.length(); i++) {
            if(x.charAt(i)=='0'){
                count++;
            }
        }
        return count+(6-x.length());
    }

    public static void main(String[] args) throws IOException{
        BufferedReader kb = new BufferedReader(new InputStreamReader(System.in));
        String ip = kb.readLine();
        long ans = 1;
        for (int i = 0; i < ip.length(); i++) {
            ans *= Math.pow(3,findNoOfZero(Integer.toBinaryString(mapper(ip.charAt(i) ))));
            ans %=1000000007;
        }
        System.out.println((ans==1)?0:ans );

    }
}


import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class RobinKarp {

	public static void main(String[] args) throws IOException {

		Scanner in = new Scanner(System.in);

		String word = in.nextLine();

		Map<Character, Integer> map = new HashMap<>();

		for(int i=0; i<=9; i++) {
			map.put((char)('0' + i), i);
		}

		for(int i=10; i<=35; i++) {
			map.put((char)('A' + i - 10), i);
		}

		for(int i=36; i<=61; i++) {
			map.put((char)('a' + i - 36), i);
		}

		map.put('-', 62);
		map.put('_', 63);

		int[] ways = new int[1<<7];

		for(int i=0; i<64; i++) {

			for(int j=0; j<64; j++) {

				ways[i & j]++;

			}
		}

		long ans = 1;

		for(int i=0; i<word.length(); i++) {

			ans *= ways[map.get(word.charAt(i))];
			ans %= (int)(1e9 + 7);

		}

		System.out.println(ans);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class C667
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int n=s.length();
		int mod = (int) 1e9+7;
		long ans=1;
		for(int i=0;i<n;i++)
		{
			int x;
			char c=s.charAt(i);
			if(Character.isUpperCase(c))
				x=(int)c-55;
			else if(Character.isLowerCase(c))
				x=(int)c-61;
			else if(c=='-')
				x=62;
			else if(c=='_')
				x=63;
			else
				x = c-'0';

			for(int j=0;j<6;j++)
			{
				int bit=x&1;
				if(bit==0)
					ans*=3;
				ans%=mod;
				x=x>>1;
			}
		}
		System.out.println(ans);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class C667
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		int n=s.length();
		int mod = (int) 1e9+7;
		long ans=1;
		for(int i=0;i<n;i++)
		{
			int x;
			char c=s.charAt(i);
			if(Character.isUpperCase(c))
				x=(int)c-55;
			else if(Character.isLowerCase(c))
				x=(int)c-61;
			else if(c=='-')
				x=62;
			else
				x=63;

			for(int j=0;j<6;j++)
			{
				int bit=x&1;
				if(bit==0)
					ans*=3;
				ans%=mod;
				x=x>>1;
			}
		}
		System.out.println(ans);
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
           ModScanner ms=new ModScanner();
           String s=ms.nextToken();
           int l=s.length();
           int[] tg=new int[64];
           int[] a=new int[l];
           long ans=1;
           for(int i=0;i<64;i++)
               tg[i]=xyz(i);
           for(int i=0;i<l;i++){
               if(s.charAt(i)>='a'&&s.charAt(i)<='z')
                   a[i]=36+(int)(s.charAt(i)-'a');
               else if(s.charAt(i)>='A'&&s.charAt(i)<='Z')
                   a[i]=10+(int)(s.charAt(i)-'A');
               else if(s.charAt(i)>='0'&&s.charAt(i)<='9')
                   a[i]=(int)(s.charAt(i)-'0');
               else if(s.charAt(i)=='-')
                   a[i]=62;
               else if(s.charAt(i)=='_')
                   a[i]=63;
               ans*=tg[a[i]];
               ans%=1000000007;
           }
           System.out.println(ans);
           }
    public static int xyz(int a){
        int ans=0;
        for(int i=0;i<64;i++)
            for(int j=0;j<64;j++)
                if((i&j)==a)
                    ans++;
        return ans;
    }
           }
    class ModScanner {
    BufferedReader br;
    StringTokenizer st;
    public ModScanner() {
    br = new BufferedReader(new InputStreamReader(System.in));
    }
    String nextToken() throws Exception {
    while (st == null || !st.hasMoreElements()) {
    st = new StringTokenizer(br.readLine());
    }
    return st.nextToken();
    }
    int nextInt() throws Exception, Exception {
    return Integer.parseInt(nextToken());
    }
    long nextLong() throws Exception {
    return Long.parseLong(nextToken());
    }
    double nextDouble() throws Exception {
    return Double.parseDouble(nextToken());
    }
    }


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
           ModScanner ms=new ModScanner();
           String s=ms.nextToken();
           int l=s.length();
           int[] tg=new int[64];
           int[] a=new int[l];
           long ans=1;
           //for(int i=0;i<64;i++)
               //tg[i]=xyz(i);
           for(int i=0;i<l;i++){
               if(s.charAt(i)>='a'&&s.charAt(i)<='z')
                   a[i]=36+(int)(s.charAt(i)-'a');
               else if(s.charAt(i)>='A'&&s.charAt(i)<='Z')
                   a[i]=10+(int)(s.charAt(i)-'A');
               else if(s.charAt(i)>='0'&&s.charAt(i)<='9')
                   a[i]=(int)(s.charAt(i)-'0');
               else if(s.charAt(i)=='-')
                   a[i]=62;
               else if(s.charAt(i)=='_')
                   a[i]=63;

               tg[i]=xyz(a[i]);
               ans*=tg[i];
               ans%=1000000007;
           }
           System.out.println(ans);
           }
    public static int xyz(int a){
        int ans=0;
        for(int i=0;i<64;i++)
            for(int j=0;j<64;j++)
                if((i&j)==a)
                    ans++;
        return ans;
    }
           }
    class ModScanner {
    BufferedReader br;
    StringTokenizer st;
    public ModScanner() {
    br = new BufferedReader(new InputStreamReader(System.in));
    }
    String nextToken() throws Exception {
    while (st == null || !st.hasMoreElements()) {
    st = new StringTokenizer(br.readLine());
    }
    return st.nextToken();
    }
    int nextInt() throws Exception, Exception {
    return Integer.parseInt(nextToken());
    }
    long nextLong() throws Exception {
    return Long.parseLong(nextToken());
    }
    double nextDouble() throws Exception {
    return Double.parseDouble(nextToken());
    }
    }


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
           ModScanner ms=new ModScanner();
           String s=ms.nextToken();
           int l=s.length();
           int[] tg=new int[64];
           int[] a=new int[l];
           long ans=1;
          // for(int i=0;i<64;i++)
            //   tg[i]=xyz(i);
           for(int i=0;i<l;i++){
               if(s.charAt(i)>='a'&&s.charAt(i)<='z')
                   a[i]=36+(int)(s.charAt(i)-'a');
               else if(s.charAt(i)>='A'&&s.charAt(i)<='Z')
                   a[i]=10+(int)(s.charAt(i)-'A');
               else if(s.charAt(i)>='0'&&s.charAt(i)<='9')
                   a[i]=(int)(s.charAt(i)-'0');
               else if(s.charAt(i)=='-')
                   a[i]=62;
               else if(s.charAt(i)=='_')
                   a[i]=63;
               int z=xyz(a[i]);
               ans*=z;
               ans%=1000000007;
           }
           System.out.println(ans);
           }
    public static int xyz(int a){
        int ans=0;
        for(int i=0;i<64;i++)
            for(int j=0;j<64;j++)
                if((i&j)==a)
                    ans++;
        return ans;
    }
           }
    class ModScanner {
    BufferedReader br;
    StringTokenizer st;
    public ModScanner() {
    br = new BufferedReader(new InputStreamReader(System.in));
    }
    String nextToken() throws Exception {
    while (st == null || !st.hasMoreElements()) {
    st = new StringTokenizer(br.readLine());
    }
    return st.nextToken();
    }
    int nextInt() throws Exception, Exception {
    return Integer.parseInt(nextToken());
    }
    long nextLong() throws Exception {
    return Long.parseLong(nextToken());
    }
    double nextDouble() throws Exception {
    return Double.parseDouble(nextToken());
    }
    }


import java.util.Scanner;

public class vanyaAndLabel {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan=new Scanner(System.in);
		String s=scan.nextLine();
		String base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
		long a=1;
		for(int i=0;i<s.length();i++){
			int x=base.indexOf(s.charAt(i));
			int t=6-Integer.bitCount(x);
			a*=Math.pow(3, t);
			a%=1000000007;
		}
		System.out.println(a);
	}

}


import java.util.Scanner;

public class vasyaAndLabel {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan=new Scanner(System.in);
		String s=scan.nextLine();
		String base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
		long a=0;
		for(int i=0;i<s.length();i++){
			int x=base.indexOf(s.charAt(i));
			a-=Integer.bitCount(x);
		}
		a+=6*s.length();
		a=(long) Math.pow(3, a);
		a%=1000000007;
		System.out.println(a);
	}

}


import java.util.Scanner;

public class vasyaAndLabel {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan=new Scanner(System.in);
		String s=scan.nextLine();
		String base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
		long a=1;
		for(int i=0;i<s.length();i++){
			int x=base.indexOf(s.charAt(i));
			int t=6-Integer.bitCount(x);
			a*=Math.pow(3, t);
			a%=1000000007;
		}
		System.out.println(a);
	}

}


import java.util.Scanner;

public class vanyaAndLabel {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan=new Scanner(System.in);
		String s=scan.nextLine();
		String base="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
		long a=1;
		for(int i=0;i<s.length();i++){
			int x=base.indexOf(s.charAt(i));
			int t=6-Integer.bitCount(x);
			a*=Math.pow(3, t);

		}
		a%=1000000007;
		System.out.println(a);
	}

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class C {

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

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

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

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

	double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	int val(char c) {
		if ('0' <= c)
			if (c <= '9')
				return c - '0';

		if ('A' <= c)
			if (c <= 'Z')
				return c - 'A' + 10;

		if ('a' <= c)
			if (c <= 'z')
				return c - 'a' + 36;

		if (c == '-')
			return 62;

		return 63;
	}

	int zc(char c) {
		int v = val(c);
		//System.err.println(c + " " + val(c) + " " + (6 - Integer.bitCount(v)));
		return 6 - Integer.bitCount(v);
	}

	void solve() throws Exception {
		char[] s = next().toCharArray();
		long z = 0;
		for (char c : s)
			z += zc(c);
		out.println(BigInteger.valueOf(3).modPow(BigInteger.valueOf(z), BigInteger.valueOf(1000000000 + 7)));
	}

	void run() {
		try {
			Locale.setDefault(Locale.US);
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new C().run();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static int convertTo64(char ch){
        if(ch<='9' && ch>='0'){
            return ch-48;
        }
        else if(ch>='A' && ch<='Z'){
            return ch-'A'+10;
        }
        else if(ch>='a' && ch<='z'){
            return ch-'a'+36;
        }
        else if(ch=='-')
            return 62;
        else return 63;
    }

    public static long mod=1000000007;

    public static long pow(long a, int n ){
        long ret=1;
        while(n>0){
            if(n%2==1) ret=(ret * a)%mod;

            a=(a*a)%mod;
            n=n/2;
        }
        return ret;
    }

    public static int c;

	public static void main(String[] args) {
		FastReader scn=new FastReader();
		c=0;
        String dm=scn.nextLine();

        for (int i=0; i<dm.length();i++  ) {
            int n=convertTo64(dm.charAt(i));

            for (int k=5; k>=0; k--) {

                if((int) ((1<<k)&n) == 0 ){
                    c++;
                }
            }
        }
        System.out.println(c);
        System.out.println(pow(3,c));

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static int convertTo64(char ch){
        if(ch<='9' && ch>='0'){
            return ch;
        }
        else if(ch>='A' && ch<='Z'){
            return ch-'A'+10;
        }
        else if(ch>='a' && ch<='z'){
            return ch-'a'+36;
        }
        else if(ch=='-')
            return 62;
        else return 63;
    }

    public static long mod=1000000000+7;

    public static long pow(long a, int n ){
        long ret=1;
        while(n>0){
            if(n%2==1) ret=(ret * a)%mod;

            a=(a*a)%mod;
            n=n/2;
        }
        return ret;
    }

    public static int c;

	public static void main(String[] args) {
		FastReader scn=new FastReader();
		c=0;
        String dm=scn.nextLine();

        for (int i=0; i<dm.length();i++  ) {
            int n=convertTo64(dm.charAt(i));

            for (int k=5; k>=0; k--) {

                if((int) ((1<<k)&n) == 0 ){
                    c++;
                }
            }
        }
        //System.out.println(c);
        System.out.println(pow(3,c));

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;
import java.util.StringTokenizer;

public class A {

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static int convertTo64(char ch){
        if(ch<='9' && ch>='0'){
            return ch-48;
        }
        else if(ch>='A' && ch<='Z'){
            return ch-'A'+10;
        }
        else if(ch>='a' && ch<='z'){
            return ch-'a'+36;
        }
        else if(ch=='-')
            return 62;
        else return 63;
    }

    public static long mod=1000000007;

    public static long pow(long a, int n ){
        long ret=1;
        while(n>0){
            if(n%2==1) ret=(ret * a)%mod;

            a=(a*a)%mod;
            n=n/2;
        }
        return ret;
    }

    public static int c;

	public static void main(String[] args) {
		FastReader scn=new FastReader();
		c=0;
        String dm=scn.nextLine();

        for (int i=0; i<dm.length();i++  ) {
            int n=convertTo64(dm.charAt(i));

            for (int k=5; k>=0; k--) {

                if((int) ((1<<k)&n) == 0 ){
                    c++;
                }
            }
        }
        //System.out.println(c);
        System.out.println(pow(3,c));

	}

}


import java.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] count = new int[64];
        for (char c : s.toCharArray()) {
            if (c >= '0' && c <= '9')
                count[c - '0']++;
            else if (c >= 'A' && c <= 'Z')
                count[c - 'A' + 10]++;
            else if (c >= 'a' && c <= 'z')
                count[c - 'a' + 36]++;
            else if (c == '-')
                count[62]++;
            else
                count[63]++;
        }

        int countZero = 0;
        for (int i = 0; i < 64; i++) {
            int countZeroI = 0;
            for (int j = 0; j < 6; j++) {
                if ((i & (1 << j)) == 0)
                    countZeroI++;
            }
            countZero += count[i] * countZeroI;
        }

        long res = 1;
        for (int i = 0; i < countZero; i++) {
            res = (res * 3) % 1000000007;
        }
        System.out.println(countZero);
        System.out.println(res);
    }

}


import java.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int[] count = new int[64];
        for (char c : s.toCharArray()) {
            if (c >= '0' && c <= '9')
                count[c - '0']++;
            else if (c >= 'A' && c <= 'Z')
                count[c - 'A' + 10]++;
            else if (c >= 'a' && c <= 'z')
                count[c - 'a' + 36]++;
            else if (c == '-')
                count[62]++;
            else
                count[63]++;
        }

        int countZero = 0;
        for (int i = 0; i < 64; i++) {
            int countZeroI = 0;
            for (int j = 0; j < 6; j++) {
                if ((i & (1 << j)) == 0)
                    countZeroI++;
            }
            countZero += count[i] * countZeroI;
        }

        long res = 1;
        for (int i = 0; i < countZero; i++) {
            res = (res * 3) % 1000000007;
        }
        // System.out.println(countZero);
        System.out.println(res);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static int getnum(char c){

		if(c>='0'&&c<='9')
			return c-'0';
		if(c>='A'&&c<='Z')
			return (int)(c-'A')+10;
		if(c>='a'&&c<='z')
			return (int)(c-'a')+36;
		if(c=='-')
			return 62;
		else
			return 63;

	}
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out=new PrintWriter(System.out);

		String r=br.readLine();

		int max=1000000007;
		int zer=0;
	for (int i = 0; i < r.length(); i++) {
		int x=getnum(r.charAt(i));

		int ones=Integer.bitCount(x);

		 zer+=6-ones;

	}
	long count=1;

	for (int i = 0; i < zer; i++) {
		count*=3;
		count%=max;
	}

		out.println(count);

		out.flush();

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static int getnum(char c){

		if(c>='0'&&c<='9')
			return c-'0';
		if(c>='A'&&c<='Z')
			return c-'A'+10;
		if(c>='a'&&c<='z')
			return (int)(c-'a')+36;
		if(c=='-')
			return 62;
		else
			return 63;

	}
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out=new PrintWriter(System.out);

		String r=br.readLine();

		int max=1000000007;
		int zer=0;
	for (int i = 0; i < r.length(); i++) {
		int x=getnum(r.charAt(i));

		int ones=Integer.bitCount(x);

		 zer+=6-ones;

	}

	Long count=(long)(Math.pow(3, zer))%max;

		out.println(count);

		out.flush();

	}
}


import java.util.Scanner;

public class Main1 {

    public static int getB64(char c) {
        if (c>='0' && c<='9') {
            return c-'0';
        } else if  (c>='A' && c<='Z') {
            return 10+(c-'A');
        } else if  (c>='a' && c<='z') {
            return 36+(c-'a');
        } else if  (c=='-') {
            return 62;
        } else {
            return 63;
        }
    }

    public static void main(String[] args) {
	// write your code here
        Scanner scanner = new Scanner(System.in);
        String line1;

        line1 = scanner.nextLine();

        long ans = 1;

        for (int i=0; i<line1.length(); i++) {
            if (line1.charAt(i) != '_') {
                int c = getB64(line1.charAt(i));
                int zeroes = 0;
                for (int j=0; j<6; j++) {
                    if (((1<<j)&c) == 0) {
                        zeroes++;
                    }
                }
                int m = 2*((int)Math.pow(2, zeroes))-1;
                //ans%=(1000000007);
                ans=((ans%1000000007)*m)%1000000007;
                //ans%=(1000000007);
            }
        }
        System.out.println(ans);
    }
}


import java.util.Scanner;

public class Main1 {

    public static int getB64(char c) {
        if (c>='0' && c<='9') {
            return c-'0';
        } else if  (c>='A' && c<='Z') {
            return 10+(c-'A');
        } else if  (c>='a' && c<='z') {
            return 36+(c-'a');
        } else if  (c=='-') {
            return 62;
        } else {
            return 63;
        }
    }

    public static void main(String[] args) {
	// write your code here
        Scanner scanner = new Scanner(System.in);
        String line1;

        line1 = scanner.nextLine();

        long ans = 1;

        for (int i=0; i<line1.length(); i++) {
            if (line1.charAt(i) != '_') {
                int c = getB64(line1.charAt(i));
                int zeroes = 0;
                for (int j=0; j<6; j++) {
                    if (((1<<j)&c) == 0) {
                        zeroes++;
                    }
                }
                int m = (int)Math.pow(3, zeroes);
                //ans%=(1000000007);
                ans=((ans%1000000007)*m)%1000000007;
                //ans%=(1000000007);
            }
        }
        System.out.println(ans);
    }
}


// practice with rainboy
import java.io.*;
import java.util.*;

public class CF677C extends PrintWriter {
	CF677C() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF677C o = new CF677C(); o.main(); o.flush();
	}

	void main() {
		int[] kk = new int[64];
		for (int a = 1; a < 64; a++)
			kk[a] = kk[a & a - 1] + 1;
		int[] ll = new int[128];
		ll['-'] = 6 - kk[62];
		ll['_'] = 6 - kk[63];
		for (byte c = '0'; c <= '9'; c++)
			ll[c] = 6 - kk[c - '0'];
		for (byte c = 'A'; c <= 'Z'; c++)
			ll[c] = 6 - kk[c - 'A' + 10];
		for (byte c = 'a'; c <= 'z'; c++)
			ll[c] = 6 - kk[c - 'a' + 36];
		byte[] cc = sc.next().getBytes();
		int n = cc.length;
		int l = 0;
		for (int i = 0; i < n; i++)
			l += ll[cc[i]];
		long ans = 1;
		while (l-- > 0)
			ans = ans * 3 % 1000000007;
		println(ans);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class round355 {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int MOD = (int) 1e9 + 7;
		TreeMap<String, Integer> map = new TreeMap<String, Integer>();
		for (int i = 0; i <= 9; i++) {
			map.put(i + "", i);
		}
		for (int i = 0; i < 26; i++) {
			map.put((char) ('A' + i) + "", 10 + i);
		}
		for (int i = 0; i < 26; i++) {
			map.put((char) ('a' + i) + "", 36 + i);
		}
		map.put("-", 62);
		map.put("_", 63);
		String s = sc.next();
		long answer = 1;
		for (int i = 0; i < s.length(); i++) {
			int x = map.get(s.charAt(i) + "");
			for (int j = 0; j < 6; j++, x >>= 1) {
				if((x & 1) == 0)
					answer = (answer * 3) % MOD;
			}
		}
		System.out.println(answer);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			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 int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class round355 {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int MOD = (int) 1e9 + 7;
		TreeMap<String, Integer> map = new TreeMap<String, Integer>();
		for (int i = 0; i < 9; i++) {
			map.put(i + "", i);
		}
		for (int i = 0; i < 26; i++) {
			map.put((char) ('A' + i) + "", 10 + i);
		}
		for (int i = 0; i < 26; i++) {
			map.put((char) ('a' + i) + "", 36 + i);
		}
		map.put("-", 62);
		map.put("_", 63);
		String s = sc.next();
		long answer = 1;
		for (int i = 0; i < s.length(); i++) {
			int x = map.get(s.charAt(i) + "");
			for (int j = 0; j < 6; j++, x >>= 1) {
				if((x & 1) == 0)
					answer = (answer * 3) % MOD;
			}
		}
		System.out.println(answer);

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			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 int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

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


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.StringTokenizer;

public class D355 {
    private static final int[][] DIRECTION = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } };

    private static class Pos {
        int r;
        int c;

        public Pos(int rr, int cc) {
            r = rr;
            c = cc;
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int p = Integer.parseInt(st.nextToken());
        Map<Integer, List<Pos>> map = new HashMap<>();
        int[][] a = new int[n][m];
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(in.readLine());
            for (int j = 0; j < m; j++) {
                int chest = Integer.parseInt(st.nextToken());
                a[i][j] = chest;
                List<Pos> chestList;
                if (map.get(chest) == null) {
                    chestList = new ArrayList<>();
                    map.put(chest, chestList);
                } else {
                    chestList = map.get(chest);
                }
                chestList.add(new Pos(i, j));
            }
        }
        List<Pos> start = new ArrayList<>();
        start.add(new Pos(0, 0));
        map.put(0, start);

        int[][] f = new int[n][m];
        for (int i = 1; i <= p; i++) {
            List<Pos> curChestList = map.get(i);
            List<Pos> prevChestList = map.get(i - 1);
            if (curChestList.size() * prevChestList.size() >= n * m) {
                int reached = 0;
                boolean[][] g = new boolean[n][m];
                Queue<Pos> queue = new LinkedList<>();
                Queue<Integer> time = new LinkedList<>();
                for (Pos prev : prevChestList) {
                    queue.offer(prev);
                    time.offer(f[prev.r][prev.c]);
                    g[prev.r][prev.c] = true;
                }
                while (reached < curChestList.size()) {
                    int tr = queue.peek().r;
                    int tc = queue.peek().c;
                    queue.poll();
                    int ttime = time.poll();
                    for (int k = 0; k < 4; k++) {
                        int nr = tr + DIRECTION[k][0];
                        int nc = tc + DIRECTION[k][1];
                        if (nr < 0 || nr >= n || nc < 0 || nc >= m)
                            continue;
                        if (!g[nr][nc]) {
                            g[nr][nc] = true;
                            queue.offer(new Pos(nr, nc));
                            time.offer(ttime + 1);
                            if (a[nr][nc] == i) {
                                f[nr][nc] = ttime + 1;
                                reached++;
                            }
                        }
                    }
                }
                continue;
            }
            for (Pos cur : curChestList) {
                for (Pos prev : prevChestList) {
                    int dist = Math.abs(cur.r - prev.r) + Math.abs(cur.c - prev.c) + f[prev.r][prev.c];
                    if (f[cur.r][cur.c] == 0 || f[cur.r][cur.c] > dist)
                        f[cur.r][cur.c] = dist;
                }
            }
        }
        Pos end = map.get(p).get(0);
        int ans = f[end.r][end.c];
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        out.write(String.valueOf(ans));
        out.close();
        System.exit(0);
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class C355 {
    private final static int MOD = (int) (1e9 + 7);

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        String s = st.nextToken();

        int zeros = 0;
        for (int i = 0; i < s.length(); i++) {
            char x = s.charAt(i);
            int number;
            if (x >= '0' && x <= '9') {
                number = x - '0';
            } else if (x >= 'A' && x <= 'Z') {
                number = x - 'A' + 10;
            } else if (x >= 'a' && x <= 'z') {
                number = x - 'a' + 36;
            } else if (x == '-') {
                number = 62;
            } else {
                number = 63;
            }
            // System.out.println("number:" + number);
            int k = 1;
            int tmp = 0;
            for (int j = 0; j < 6; j++) {
                if ((number & k) == 0)
                    tmp++;
                k <<= 1;
            }
            zeros += tmp;
        }

        long ans = modPow(3, zeros);

        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        out.write(String.valueOf(ans));
        out.close();
        System.exit(0);
    }

    private static long modPow(int a, int k) {
        if (k == 0)
            return 1;
        long t = (long) modPow(a, k / 2);
        t = (t * t) % MOD;
        if (k % 2 == 1)
            t = (t * a) % MOD;
        return t;
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class C355 {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        String s = st.nextToken();
        BigInteger ans = BigInteger.ONE;
        int zeros = 0;
        for (int i = 0; i < s.length(); i++) {
            char x = s.charAt(i);
            int number;
            if (x >= '0' && x <= '9') {
                number = x - '0';
            } else if (x >= 'A' && x <= 'Z') {
                number = x - 'A' + 10;
            } else if (x >= 'a' && x <= 'z') {
                number = x - 'a' + 36;
            } else if (x == '-') {
                number = 62;
            } else {
                number = 63;
            }
            // System.out.println("number:" + number);
            int k = 1;
            int tmp = 0;
            for (int j = 0; j < 6; j++) {
                if ((number & k) == 0)
                    tmp++;
                k <<= 1;
            }
            zeros += tmp;
            // System.out.println("zeros:" + zeros);
        }

        for (int i = 0; i < zeros; i++) {
            ans = ans.multiply(BigInteger.valueOf(3));
        }
        ans = ans.mod(BigInteger.valueOf(1000000000 + 7));

        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        out.write(String.valueOf(ans.intValue()));
        out.close();
        System.exit(0);
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class C355 {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        String s = st.nextToken();
        BigInteger ans = BigInteger.ONE;
        int zeros = 0;
        for (int i = 0; i < s.length(); i++) {
            char x = s.charAt(i);
            int number;
            if (x >= '0' && x <= '9') {
                number = x - '0';
            } else if (x >= 'A' && x <= 'Z') {
                number = x - 'A' + 10;
            } else if (x >= 'a' && x <= 'z') {
                number = x - 'a' + 36;
            } else if (x == '-') {
                number = 62;
            } else {
                number = 63;
            }
            // System.out.println("number:" + number);
            zeros += 6 - Integer.bitCount(number);
            // System.out.println("zeros:" + zeros);
        }

        for (int i = 0; i < zeros; i++) {
            ans = ans.multiply(BigInteger.valueOf(3));
        }
        ans = ans.mod(BigInteger.valueOf(1000000000 + 7));

        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        out.write(String.valueOf(ans.intValue()));
        out.close();
        System.exit(0);
    }
}


import java.io.*;
import java.util.*;
public class DIV355C
{
	BufferedReader in;
	PrintWriter ob;
	StringTokenizer st;
	public static void main(String[] args) throws IOException {
		new DIV355C().run();
	}
	void run()throws IOException {
		in=new BufferedReader(new InputStreamReader(System.in));
		ob=new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve() throws IOException {
		int cnt[]=new int[64];
		for (int k=0; k<64 ; k++ ) {
			int res=0;
			for (int i=0; i<64 ; i++ ) {
				for (int j=0; j<64 ; j++ ) {
					if((j&i)==k) {
						++res;
					}
				}
			}
			cnt[k]=res;
		}
		Hashtable<Character,Integer> ht=new Hashtable<Character,Integer>();
		char ch='0';
		for (int i=0; i<=9 ; i++ ) {
				ht.put(ch,i);
				ch+=1;
		}
		 ch='A';
		for (int i=10; i<=35 ; i++ ) {
			ht.put(ch,i);
			ch+=1;
		}
		 ch='a';
		for (int i=36; i<=61 ; i++ ) {
			ht.put(ch,i);
			ch+=1;
		}
		ht.put('-',62);
		ht.put('_',63);
		char s[]=ns().toCharArray();
		long ans=1,mod=(int)1e9+7;
		for (int i=0; i<s.length ; i++ ) {
			int k=ht.get(s[i]);
			ans=((ans%mod)*1L*((cnt[k])%mod)%mod);
		}
		ob.println(ans);
	}
	String ns() throws IOException {
		return nextToken();
	}
	int ni()throws IOException {
		return Integer.parseInt(nextToken());
	}
	String nextToken() throws IOException {
		if(st==null || !st.hasMoreTokens())
			st=new StringTokenizer(in.readLine());
		return st.nextToken();
	}
}


import java.io.*;
import java.util.*;
public class div355Cn
{
	BufferedReader in;
	PrintWriter ob;
	StringTokenizer st;
	public static void main(String[] args) throws IOException {
		new div355Cn().run();
	}
	void run()throws IOException {
		in=new BufferedReader(new InputStreamReader(System.in));
		ob=new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve() throws IOException {
		Hashtable<Character,Integer> ht=new Hashtable<Character,Integer>();
		char ch='0';
		for (int i=0; i<=9 ; i++ ) {
				ht.put(ch,i);
				ch+=1;
		}
		 ch='A';
		for (int i=10; i<=35 ; i++ ) {
			ht.put(ch,i);
			ch+=1;
		}
		 ch='a';
		for (int i=36; i<=61 ; i++ ) {
			ht.put(ch,i);
			ch+=1;
		}
		ht.put('-',62);
		ht.put('_',63);
		char s[]=ns().toCharArray();
		long ans=1,mod=(int)1e9+7;
		long z=0;
		for (int i=0; i<s.length ; i++ ) {
			int k=ht.get(s[i]);
			z+=6-Integer.bitCount(k);
		}
		ans=powmod(3L,z,mod);
		ob.println(ans);
	}
	long powmod(long base,long expo,long MOD)
	{
		long res=1L;
		long power=base%MOD;
		while(expo>0)
		{
			if(expo%2==1)
				res=(res*power)%MOD;
			power=(power*power)%MOD;
			expo/=2;
		}
		return res;
	}
	String ns() throws IOException {
		return nextToken();
	}
	int ni()throws IOException {
		return Integer.parseInt(nextToken());
	}
	String nextToken() throws IOException {
		if(st==null || !st.hasMoreTokens())
			st=new StringTokenizer(in.readLine());
		return st.nextToken();
	}
}


import java.util.Scanner;
import java.util.*;

/**
 *
 * @author IT manager
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
      public static int MOD=1000000007;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
         int [] freq= new int [64];
       String s = scanner.nextLine();// number of  potetos

    for(int i=0; i<64;i++){
    for(int j=0; j<64;j++){
            freq[i&j]++;
    }

    }

    long result=1;
    for (int i=0; i<s.length();i++){
        char x=s.charAt(i);
        int dig = 0;
        if(x >= '0' && x <= '9'){
        dig=s.charAt(i)-'0';
        }
         else if(x >= 'A' && x <= 'Z'){
        dig=s.charAt(i)-'A'+10 ;
        }
         else if(x >= 'a' && x<= 'z'){
        dig=s.charAt(i)-'a'+36;
        }
        else if(x == '-'){
        dig=62;
        }
        else {
        dig=63;
        }
        result=(result*freq[dig]) % MOD;
    }

      System.out.println(result);

}
}


import java.util.Scanner;
import java.util.*;

/**
 *
 * @author IT manager
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
      public static int MOD=1000000007;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
         int [] freq= new int [64];
       String s = scanner.nextLine();// number of  potetos

    for(int i=0; i<64;i++){
    for(int j=0; j<64;j++){
            freq[i&j]++;
    }

    }

    long result=1;
    for (int i=0; i<s.length();i++){
        char x=s.charAt(i);
        int dig = 0;
        if(x > '0' && x< '9'){
        dig=s.charAt(i)-'0';
        }
         else if(x > 'A' && x< 'Z'){
        dig=s.charAt(i)-'A'+10 ;
        }
         else if(x > 'a' && x< 'z'){
        dig=s.charAt(i)-'a'+36;
        }
        else if(x == '-'){
        dig=62;
        }
        else {
        dig=63;
        }
        result=(result*freq[dig]) % MOD;
    }

      System.out.println(result);

}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.xml.bind.DatatypeConverter;

public class vanya_label {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		String input=bf.readLine();int zeroes=0;
		long zero=0; long num=0;
		for (int i = 0; i < input.length(); i++) {

		    int tmp=convert_base(input.charAt(i));
			zero+=zeroes(tmp);

		}
		long ans=1;
		for (long i = 0; i < zero; i++) {
			ans = ans*3%((int)1E9+7);
			///System.out.println(ans);
		}
		System.out.println(ans);
	}
	public static int convert_base(char c){

		if(c>='0'&&c<='9'){
			return c-'0';
		}
		else if(c>='A'&& c<='Z'){
			return c-'A'+10;
		}
		else if(c>='a'&&c<='z'){
			return c-'a'+36;

		}
		else if(c=='_'){
			return 63;
		}
		else{
			return 62;
		}

	}
	public static int zeroes(int input){
		String i=Integer.toBinaryString(input);
		int zeroes=0;
		if(i.length()<6)
			zeroes=6-i.length();
		for (int i2 = 0; i2 < i.length(); i2++) {
			if(i.charAt(i2)=='0')
				++zeroes;
		}
		return zeroes;

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Solution {

    public static int toInt(char ch) {
        if (ch >= '0' && ch <= '9')
            return ch - '0';
        else if (ch >= 'A' && ch <= 'Z')
            return ch - 'A' + 10;
        else if (ch >= 'a' && ch <= 'z')
            return ch - 'a' + 36;
        else if (ch == '-')
            return 62;
        else if (ch == '_')
            return 63;
        else
            throw new RuntimeException("Wrong input");

    }

    public static void main(String[] args) {
        MyScanner in = new MyScanner();
        String str = in.next();
        long answer = 1;
        for (int i = 0; i < str.length(); i++) {
            String bin = Integer.toBinaryString(toInt(str.charAt(i)));
            int count = 6;
            for (int j = 0; j < bin.length(); j++)
                if (bin.charAt(j) == '1')
                    count -= 1;
            for (int j = 0; j < count; j++)
                answer = (answer * 3) % 1000000007;
        }
        System.out.println(answer);
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static long MOD = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		String s = sc.next();

		long[] list = new long[255];
		for (int i = 0; i < 10; i++) {
			list['0' + i] = calc(i);
		}
		for (int i = 0; i < 26; i++) {
			list['A' + i] = calc(10 + i);
		}
		for (int i = 0; i < 26; i++) {
			list['a' + i] = calc(36 + i);
		}
		list['-'] = calc(62);
		list['_'] = calc(63);

		long ret = 1;
		for (char c : s.toCharArray()) {
			ret *= list[c];
			ret %= MOD;
		}
		System.out.println(ret);
	}

	private static long calc(int i) {
		int x = 6 - Integer.bitCount(i);
		return (long) Math.pow(3, x);
	}

}

class FastScanner {
	public static String debug = null;

	private final InputStream in = System.in;
	private int ptr = 0;
	private int buflen = 0;
	private byte[] buffer = new byte[1024];
	private boolean eos = false;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				if (debug != null) {
					buflen = debug.length();
					buffer = debug.getBytes();
					debug = "";
					eos = true;
				} else {
					buflen = in.read(buffer);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen < 0) {
				eos = true;
				return false;
			} else if (buflen == 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean isEOS() {
		return this.eos;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		return (int) nextLong();
	}

	public long[] nextLongList(int n) {
		return nextLongTable(1, n)[0];
	}

	public int[] nextIntList(int n) {
		return nextIntTable(1, n)[0];
	}

	public long[][] nextLongTable(int n, int m) {
		long[][] ret = new long[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextLong();
			}
		}
		return ret;
	}

	public int[][] nextIntTable(int n, int m) {
		int[][] ret = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextInt();
			}
		}
		return ret;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static long MOD = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		String s = sc.next();

		long[] list = new long[255];
		for (int i = 0; i < 9; i++) {
			list['0' + i] = calc(i);
		}
		for (int i = 0; i < 26; i++) {
			list['A' + i] = calc(10 + i);
		}
		for (int i = 0; i < 26; i++) {
			list['a' + i] = calc(36 + i);
		}
		list['-'] = calc(62);
		list['_'] = calc(63);

		long ret = 1;
		for (char c : s.toCharArray()) {
			ret *= list[c];
			ret %= MOD;
		}
		System.out.println(ret);
	}

	private static long calc(int i) {
		int x = 6 - Integer.bitCount(i);
		return (long) Math.pow(3, x);
	}

}

class FastScanner {
	public static String debug = null;

	private final InputStream in = System.in;
	private int ptr = 0;
	private int buflen = 0;
	private byte[] buffer = new byte[1024];
	private boolean eos = false;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				if (debug != null) {
					buflen = debug.length();
					buffer = debug.getBytes();
					debug = "";
					eos = true;
				} else {
					buflen = in.read(buffer);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen < 0) {
				eos = true;
				return false;
			} else if (buflen == 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean isEOS() {
		return this.eos;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		return (int) nextLong();
	}

	public long[] nextLongList(int n) {
		return nextLongTable(1, n)[0];
	}

	public int[] nextIntList(int n) {
		return nextIntTable(1, n)[0];
	}

	public long[][] nextLongTable(int n, int m) {
		long[][] ret = new long[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextLong();
			}
		}
		return ret;
	}

	public int[][] nextIntTable(int n, int m) {
		int[][] ret = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextInt();
			}
		}
		return ret;
	}
}


import java.util.*;
import java.io.*;

public class Test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	//	PrintWriter w = new PrintWriter(System.out);
		String s=sc.nextLine();
		long ans=0;
		for(int i=0;i<s.length();i++){
			char c=s.charAt(i);
			int k;
			if(c>='0'&&c<='9'){
				k=c-48;
			}
			else if(c>='A'&&c<='Z'){
				k=c-65+10;
			}
			else if(c>='a'&&c<='z'){
				k=c-97+36;
			}
			else if(c=='-') k=62;
			else k=63;

			String nw=Integer.toBinaryString(k);
		//	System.out.println(nw);
			int l=nw.length();
			for(int j=0;j<6;j++){
				if(j<l&&nw.charAt(j)=='0') ans++;
				else if(j>=l) ans++;
			}
			ans=ans%(power(10,9)+7);
		}
		long x=power(3,ans);
		long y=x;
		ans=y%((int)power(10, 9)+7);
		//System.out.println(((int)power(10,9)+7));
		System.out.println(ans);
	}
	public static long power(long a,long b)
	{
	    long ans=1;
	    while(b>0)
	    {
	        if(b%2==1)
	        {
	            ans*=a;
	        }
	        a*=a;
	        b/=2;
	    }
	    return ans;
	}
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

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

	public long[] nextLongArray(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	public void pArray(int[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public void pArray(long[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}

}


import java.util.*;
import java.io.*;

public class Test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	//	PrintWriter w = new PrintWriter(System.out);
		String s=sc.nextLine();
		long ans=0;
		for(int i=0;i<s.length();i++){
			char c=s.charAt(i);
			int k;
			if(c>='0'&&c<='9'){
				k=c-48;
			}
			else if(c>='A'&&c<='Z'){
				k=c-65+10;
			}
			else if(c>='a'&&c<='z'){
				k=c-97+36;
			}
			else if(c=='-') k=62;
			else k=63;

			String nw=Integer.toBinaryString(k);
		//	System.out.println(nw);
			int l=nw.length();
			for(int j=0;j<6;j++){
				if(j<l&&nw.charAt(j)=='0') ans++;
				else if(j>=l) ans++;
			}
		}
		long x=power(3,ans);
		long y=x;
		ans=y%((int)Math.pow(10, 9)+7);
		System.out.println(ans);
	}
	public static long power(long a,long b)
	{
	    long ans=1;
	    while(b>0)
	    {
	        if(b%2==1)
	        {
	            ans*=a;
	        }
	        a*=a;
	        b/=2;
	    }
	    return ans;
	}
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

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

	public long[] nextLongArray(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	public void pArray(int[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public void pArray(long[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}

}


import java.util.*;
import java.io.*;

public class Test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	//	PrintWriter w = new PrintWriter(System.out);
		String s=sc.nextLine();
		long ans=0;
		for(int i=0;i<s.length();i++){
			char c=s.charAt(i);
			int k;
			if(c>='0'&&c<='9'){
				k=c-48;
			}
			else if(c>='A'&&c<='Z'){
				k=c-65+10;
			}
			else if(c>='a'&&c<='z'){
				k=c-97+36;
			}
			else if(c=='-') k=62;
			else k=63;

			String nw=Integer.toBinaryString(k);
		//	System.out.println(nw);
			int l=nw.length();
			for(int j=0;j<6;j++){
				if(j<l&&nw.charAt(j)=='0') ans++;
				else if(j>=l) ans++;
			}
			ans=ans%(power(10,9)+7);
		}
		long x=power(3,ans);
		long y=x;
		ans=y%((int)power(10, 9)+7);
		//System.out.println(((int)power(10,9)+7));
		System.out.println(ans);
	}
	public static long power(long a,long b)
	{
	    long ans=1;
	    while(b>0)
	    {
	        if(b%2==1)
	        {
	            ans*=a;
	            ans=ans%1000000007;
	        }
	        a*=a;
	        a=a%1000000007;
	        b/=2;
	    }
	    return ans%1000000007;
	}
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

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

	public long[] nextLongArray(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	public void pArray(int[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public void pArray(long[] arr){
		for (int i=0; i<arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}

}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Main
{
	public static void main(String[] args)
	throws IOException
	{
		Reader r = new Reader();
		r.readLine();

		int []count = new int[64];
		int res;
		for (int i=0;i < 64;++i)
		{
			for (int j=0;j < 64;++j)
			{
				res = i & j;

				if (res > -1 && res < 64)
				{
					++count[res];
				}
			}
		}

		HashMap<Character,Integer> map = new HashMap<Character,Integer>();

		for (char ch='0';ch <= '9';++ch)
			map.put(ch, count[ch - '0']);

		for (char ch='A';ch <= 'Z';++ch)
			map.put(ch, count[ch - 'A' + 10]);

		for (char ch='a';ch <= 'z';++ch)
			map.put(ch, count[ch - 'a' + 36]);

		map.put('-', count[62]);
		map.put('_', count[63]);

		String str = r.readString(0);

		long ans = 1L;
		for (char ch:str.toCharArray())
		{
			ans *= map.get(ch);
			ans %= 1000000007;
		}

		System.out.println(ans);

		r.close();
	}
}

class Reader
{
    private BufferedReader reader;
    private String line[];

    public Reader()
    {
        reader = new BufferedReader(
            new InputStreamReader(System.in));
    }

    public void readLine()
    throws IOException
    {
        line = reader.readLine().split(" ");
    }

    public int readInt(int pos)
    throws IOException
    {
        return Integer.parseInt(line[pos]);
    }

    public double readDouble(int pos)
    throws IOException
    {
        return Double.parseDouble(line[pos]);
    }

    public long readLong(int pos)
    throws IOException
    {
        return Long.parseLong(line[pos]);
    }

    public String readString(int pos)
    throws IOException
    {
        return line[pos];
    }

    public void close()
    throws IOException
    {
        reader.close();
    }
}


import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Main
{
	public static void main(String[] args)
	throws IOException
	{
		Reader r = new Reader();
		r.readLine();

		int []count = new int[64];
		int res;
		for (int i=0;i < 64;++i)
		{
			for (int j=0;j < 64;++j)
			{
				res = i & j;

				if (res > -1 && res < 64)
				{

					++count[res];
				}
			}
		}

		HashMap<Character,Integer> map = new HashMap<Character,Integer>();

		for (char ch='0';ch <= '9';++ch)
			map.put(ch, count[ch - '0']);

		for (char ch='A';ch <= 'Z';++ch)
			map.put(ch, count[ch - 'A' + 10]);

		for (char ch='a';ch <= 'z';++ch)
			map.put(ch, count[ch - 'a' + 36]);

		map.put('-', count[62]);
		map.put('_', count[63]);

		String str = r.readString(0);

		long ans = 1L;
		for (char ch:str.toCharArray())
		{
			ans *= map.get(ch);
		}

		System.out.println(ans % (1000000007));

		r.close();
	}
}

class Reader
{
    private BufferedReader reader;
    private String line[];

    public Reader()
    {
        reader = new BufferedReader(
            new InputStreamReader(System.in));
    }

    public void readLine()
    throws IOException
    {
        line = reader.readLine().split(" ");
    }

    public int readInt(int pos)
    throws IOException
    {
        return Integer.parseInt(line[pos]);
    }

    public double readDouble(int pos)
    throws IOException
    {
        return Double.parseDouble(line[pos]);
    }

    public long readLong(int pos)
    throws IOException
    {
        return Long.parseLong(line[pos]);
    }

    public String readString(int pos)
    throws IOException
    {
        return line[pos];
    }

    public void close()
    throws IOException
    {
        reader.close();
    }
}