Malek lives in an apartment block with 100 floors numbered from 0 to 99. The apartment has an elevator with a digital counter showing the floor that the elevator is currently on. The elevator shows each digit of a number with 7 light sticks by turning them on or off. The picture below shows how the elevator shows each digit.[Image]

One day when Malek wanted to go from floor 88 to floor 0 using the elevator he noticed that the counter shows number 89 instead of 88. Then when the elevator started moving the number on the counter changed to 87. After a little thinking Malek came to the conclusion that there is only one explanation for this: One of the sticks of the counter was broken. Later that day Malek was thinking about the broken stick and suddenly he came up with the following problem.

Suppose the digital counter is showing number n. Malek calls an integer x (0 ≤ x ≤ 99) good if it's possible that the digital counter was supposed to show x but because of some(possibly none) broken sticks it's showing n instead. Malek wants to know number of good integers for a specific n. So you must write a program that calculates this number. Please note that the counter always shows two digits.


-----Input-----

The only line of input contains exactly two digits representing number n (0 ≤ n ≤ 99). Note that n may have a leading zero.


-----Output-----

In the only line of the output print the number of good integers.


-----Examples-----
Input
89

Output
2

Input
00

Output
4

Input
73

Output
15



-----Note-----

In the first sample the counter may be supposed to show 88 or 89.

In the second sample the good integers are 00, 08, 80 and 88.

In the third sample the good integers are 03, 08, 09, 33, 38, 39, 73, 78, 79, 83, 88, 89, 93, 98, 99.

Difficulty: interview

Starter code:

Solutions:
# -*- coding: utf-8 -*-

ngoods = {
    '0': 2,
    '1': 7,
    '2': 2,
    '3': 3,
    '4': 3,
    '5': 4,
    '6': 2,
    '7': 5,
    '8': 1,
    '9': 2
}

digits = input().strip()
print(ngoods[digits[0]] * ngoods[digits[1]])


m = {
    0: 2,
    1: 7,
    2: 2,
    3: 3,
    4: 3,
    5: 4,
    6: 2,
    7: 5,
    8: 1,
    9: 2,
}
h, l = divmod(int(input()), 10)
print(m[h] * m[l])


a = input()
nums = [2,7,2,3,3,4,2,5,1,2]
print(nums[int(a[0])]*nums[int(a[1])])


can = {1: [0, 1, 3, 4, 7, 8, 9], 2: [2, 8], 3: [3, 8, 9], 4: [4, 8, 9], 5: [5, 6, 8, 9], 6: [6, 8], 7: [0, 3, 7, 8, 9], 8: [8], 9 : [8, 9], 0: [0, 8]}

n = int(input())
a, b = n // 10, n % 10
print(len(can[a]) * len(can[b]))

n=input()
dic={'0':2,'1':7,'2':2,'3':3,'4':3,'5':4,'6':2,'7':5,'8':1,'9':2}
print(dic[n[0]]*dic[n[1]])


Count = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]
print((lambda x: Count[x[0]] * Count[x[1]])(list(map(int, list(input())))))


d = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]

n = input()
print(d[int(n[0])] * d[int(n[1])])


from collections import defaultdict

def main(n):
    tr = {0:2,1:7,2:2,3:3,4:3,5:4,6:2,7:5,8:1,9:2}
    print(tr[int(n[0])] * tr[int(n[1])])
    return
    mx = -99999999999
    a.sort()
    b.sort()
    a2 = 0  # last b 2p
    b2 = 0  # last a 2p
    for d in sorted(list(set([0]+a+b))):
        for a2 in range(a2,n+1):
            if a2==n or a[a2] > d: break
        for b2 in range(b2,m+1):
            if b2==m or b[b2] > d: break
        s1 = a2 * 2 + (n-a2)*3
        s2 = b2 * 2 + (m-b2)*3
        if s1-s2 > mx:
            mx = s1-s2
            res = "{}:{}".format(s1,s2)
    print(res)


def main_input():
    #n = int(input())
    n = input()
    #a = [int(i) for i in input().split()]
    #a = map(int, input().split())
    #m = int(input())
    #b = [int(i) for i in input().split()]
    main(n)

def __starting_point():
    main_input()

__starting_point()

inp= (input())
if inp[0]== "0": a= 2 
if inp[0]== "1": a= 7
if inp[0]== "2": a= 2
if inp[0]== "3": a= 3
if inp[0]== "4": a= 3
if inp[0]== "5": a= 4
if inp[0]== "6" :a= 2
if inp[0]== "7": a= 5
if inp[0]== "8" :a= 1
if inp[0]== "9": a= 2
if inp[1]== "0": b= 2
if inp[1]== "1": b= 7
if inp[1]== "2": b= 2
if inp[1]== "3": b= 3
if inp[1]== "4": b= 3
if inp[1]== "5": b= 4
if inp[1]== "6": b= 2
if inp[1]== "7": b= 5
if inp[1]== "8": b= 1
if inp[1]== "9": b= 2

print(a*b)

import itertools
import math

answers = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]

def main():
	a, b = list(map(int, input()))
	print(answers[a] * answers[b])

def __starting_point():
	main()

__starting_point()

def seg_n(n):
   n = int(n)
   if n == 9:
      return 2
   elif n== 8:
      return 1
   elif n== 7:
      return 5
   elif n== 6:
      return 2
   elif n== 5:
      return 4
   elif n== 4:
      return 3
   elif n== 3:
      return 3
   elif n== 2:
      return 2
   elif n== 1:
      return 7
   else:
      return 2
n = input()
summ = 1
f = seg_n(n[0])
z = seg_n(n[1])
print(f*z)


n = input()
n = list(n)
mylist = []
for i in range(len(n)):
    if n[i] == '0':
        mylist.append(2)
    elif n[i] == '1':
        mylist.append(7)
    elif n[i] == '2':
        mylist.append(2)
    elif n[i] == '3':
        mylist.append(3)
    elif n[i] == '4':
        mylist.append(3)
    elif n[i] == '5':
        mylist.append(4)
    elif n[i] == '6':
        mylist.append(2)
    elif n[i] == '7':
        mylist.append(5)
    elif n[i] == '8':
        mylist.append(1)
    elif n[i] == '9':
        mylist.append(2)
print(mylist[0]*mylist[1])


s = str(input())
x1 = int(s[0])
x2 = int(s[1])
y = [[0] * 7 for i in range(10)]
y[0] = [1, 1, 1, 0, 1, 1, 1]
y[1] = [0, 0, 0, 0, 0, 1, 1]
y[2] = [0, 1, 1, 1, 1, 1, 0]
y[3] = [0, 0, 1, 1, 1, 1, 1]
y[4] = [1, 0, 0, 1, 0, 1, 1]
y[5] = [1, 0, 1, 1, 1, 0, 1]
y[6] = [1, 1, 1, 1, 1, 0, 1]
y[7] = [0, 0, 1, 0, 0, 1, 1]
y[8] = [1, 1, 1, 1, 1, 1, 1]
y[9] = [1, 0, 1, 1, 1, 1, 1]
q1 = 0
q2 = 0
sum = 0
flag = True
for i in range(100):
    q1 = i // 10
    q2 = i % 10
    for j in range(7):
        if int(y[x1][j]) - int(y[q1][j]) > 0:
            flag = False
        if int(y[x2][j]) - int(y[q2][j]) > 0:
            flag = False
    if flag:
        sum += 1
    flag = True
print(sum)

n = int(input())
a1, a2 = n // 10, n % 10
t = { 0: 2,
      1: 7,
      2: 2,
      3: 3,
      4: 3,
      5: 4,
      6: 2,
      7: 5,
      8: 1,
      9: 2}
print(t[a1] * t[a2])


type=[[1,1,1,1,1,1,0],[0,0,1,1,0,0,0],[0,1,1,0,1,1,1],[0,1,1,1,1,0,1],[1,0,1,1,0,0,1],[1,1,0,1,1,0,1],[1,1,0,1,1,1,1],[0,1,1,1,0,0,0],[1,1,1,1,1,1,1],[1,1,1,1,1,0,1]]
def check(dis,x):
    for i in range(0,7):
        if(type[dis][i] and not type[x][i]):
            return False
    return True
(a,b)=input()
sum1=0
for i in range(0,10):
    if(check(int(a),i)):
        sum1+=1
sum2=0
for i in range(0,10):
    if(check(int(b),i)):
        sum2+=1
print(sum1*sum2)

n=input()
v=[int(i) for i in '2723342512']
s='0'+n if len(n)==1 else n
print(v[int(s[0])]*v[int(s[1])])

def main():
    m = (
        (1, 1, 1, 0, 1, 1, 1), (0, 0, 1, 0, 0, 1, 0), (1, 0, 1, 1, 1, 0, 1), (1, 0, 1, 1, 0, 1, 1),
        (0, 1, 1, 1, 0, 1, 0),
        (1, 1, 0, 1, 0, 1, 1), (1, 1, 0, 1, 1, 1, 1), (1, 0, 1, 0, 0, 1, 0), (1, 1, 1, 1, 1, 1, 1),
        (1, 1, 1, 1, 0, 1, 1))
    u, v = list(map(int, input()))
    tot = 0
    for i in range(100):
        x, y = divmod(i, 10)
        diff = 0
        for aa, bb in ((u, x), (v, y)):
            for a, b in zip(m[aa], m[bb]):
                if a > b:
                    diff = 100
                    break
                diff += a < b
        if diff < 100:
            tot += 1
    print(tot)


def __starting_point():
    main()

__starting_point()

d = dict()
d['0'] = [0, 8]
d['1'] = [0, 1, 3, 4, 7, 8, 9]
d['2'] = [2, 8]
d['3'] = [3, 8, 9]
d['4'] = [4, 8, 9]
d['5'] = [5, 6, 8, 9]
d['6'] = [6, 8]
d['7'] = [0, 3, 7, 8, 9]
d['8'] = [8]
d['9'] = [8, 9]

s = input()

ret = 1
for j in [len(d[i]) for i in s]:
    ret *= j

print(ret)


'''
Created on ١٣‏/١٢‏/٢٠١٤

@author: mohamed265
'''
t = input()
lis = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]
print(lis[int(t[0])] * lis[int(t[1])])


n=int(input())
y=n%10
d=n//10
if y==0:
    a=[0,8]
if y==1:
    a=[0,1,3,4,7,8,9]
if y==2:
    a=[2,8]
if y==3:
    a=[3,8,9]
if y==4:
    a=[4,8,9]
if y==5:
    a=[5,6,8,9]
if y==6:
    a=[6,8]
if y==7:
    a=[0,3,7,8,9]
if y==8:
    a=[8]
if y==9:
    a=[8,9]
if d==0:
    b=[0,8]
if d==1:
    b=[0,1,3,4,7,8,9]
if d==2:
    b=[2,8]
if d==3:
    b=[3,8,9]
if d==4:
    b=[4,8,9]
if d==5:
    b=[5,6,8,9]
if d==6:
    b=[6,8]
if d==7:
    b=[0,3,7,8,9]
if d==8:
    b=[8]
if d==9:
    b=[8,9]
print(len(a)*len(b))


#s = str(input())
#
#balance = 0
#sh = 0
#
#for i in s:
#    if i == "(": balance += 1
#    if i == ")": balance -= 1
#    if i == "#": sh += 1

#print(balance, sh)

s = str(input())

k1, k2 = 0, 0

if s[0] == "0": k1 = 2
if s[0] == "1": k1 = 7
if s[0] == "2": k1 = 2
if s[0] == "3": k1 = 3
if s[0] == "4": k1 = 3
if s[0] == "5": k1 = 4
if s[0] == "6": k1 = 2
if s[0] == "7": k1 = 5
if s[0] == "8": k1 = 1
if s[0] == "9": k1 = 2

if s[1] == "0": k2 = 2
if s[1] == "1": k2 = 7
if s[1] == "2": k2 = 2
if s[1] == "3": k2 = 3
if s[1] == "4": k2 = 3
if s[1] == "5": k2 = 4
if s[1] == "6": k2 = 2
if s[1] == "7": k2 = 5
if s[1] == "8": k2 = 1
if s[1] == "9": k2 = 2

print(k1 * k2)
















data = []
data.extend([2,7,2,3,3,4,2,5,1,2])
line = input()
x = data[int(line[0])]
y = data[int(line[1])]
print(x*y)


__author__ = 'Rakshak.R.Hegde'
"""
Created on Dec 13 2014 PM 10:04

@author: Rakshak.R.Hegde
"""
design = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]
n1, n2 = map(int, input())
count = design[n1]*design[n2]
print(count)

a = [2, 7, 2, 3, 3, 4, 2, 5, 1, 2]
#print(len(a))
n = input()
ans = a[(ord(n[0]) - ord('0'))] * a[(ord(n[1]) - ord('0'))]
print(ans)