Unary is a minimalistic Brainfuck dialect in which programs are written using only one token. 

Brainfuck programs use 8 commands: "+", "-", "[", "]", "<", ">", "." and "," (their meaning is not important for the purposes of this problem). Unary programs are created from Brainfuck programs using the following algorithm. First, replace each command with a corresponding binary code, using the following conversion table: 

  * ">"  →  1000, 
  * "<"  →  1001, 
  * "+"  →  1010, 
  * "-"  →  1011, 
  * "."  →  1100, 
  * ","  →  1101, 
  * "["  →  1110, 
  * "]"  →  1111. 



Next, concatenate the resulting binary codes into one binary number in the same order as in the program. Finally, write this number using unary numeral system — this is the Unary program equivalent to the original Brainfuck one.

You are given a Brainfuck program. Your task is to calculate the size of the equivalent Unary program, and print it modulo 1000003 (106 + 3).

Input

The input will consist of a single line p which gives a Brainfuck program. String p will contain between 1 and 100 characters, inclusive. Each character of p will be "+", "-", "[", "]", "<", ">", "." or ",".

Output

Output the size of the equivalent Unary program modulo 1000003 (106 + 3).

Examples

Input

,.


Output

220


Input

++++[&gt;,.&lt;-]


Output

61425

Note

To write a number n in unary numeral system, one simply has to write 1 n times. For example, 5 written in unary system will be 11111.

In the first example replacing Brainfuck commands with binary code will give us 1101 1100. After we concatenate the codes, we'll get 11011100 in binary system, or 220 in decimal. That's exactly the number of tokens in the equivalent Unary program.

Difficulty: EASY

Solutions:
s = input()
ans = ''
for i in s:
	if i == '>':
		ans += '1000'
	elif i == '<':
		ans += '1001'
	elif i == '+':
		ans += '1010'
	elif i == '-':
		ans += '1011'
	elif i == '.':
		ans += '1100'
	elif i == ',':
		ans += '1101'
	elif i == '[':
		ans += '1110'
	elif i == ']':
		ans += '1111'
print(int(ans, 2) % 1000003)


mod = 1000000.0 + 3
s = input()
bi = ''
for i in s:
	if i == '>':
		bi = bi + '1000'
	if i == '<':
		bi = bi + '1001'
	if i == '+':
		bi = bi + '1010'
	if i == '-':
		bi = bi + '1011'
	if i == '.':
		bi = bi + '1100'
	if i == ',':
		bi = bi + '1101'
	if i == '[':
		bi = bi + '1110'
	if i == ']':
		bi = bi + '1111'
ans = 0
for i in range(len(bi)):
	if bi[i] == '1':
		ans += 2 ** (len(bi) - i - 1) % mod
print(int(ans % mod))


s = input()
c = ''
for i in s:
	if i == '>':
		c += '1000'
	elif i == '<':
		c += '1001'
	elif i == '+':
		c += '1010'
	elif i == '-':
		c += '1011'
	elif i == '.':
		c += '1100'
	elif i == ',':
		c += '1101'
	elif i == '[':
		c += '1110'
	elif i == ']':
		c += '1111'
c = c[::-1]
r = 0
mod = 1000003
for i in range(len(c)):
	if c[i] == '1':
		r += 2 ** i % mod
		r %= mod
print(int(r))


import os
import sys
from collections import defaultdict
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def solve():
	dd = defaultdict(str)
	dd['>'] = '1000'
	dd['<'] = '1001'
	dd['+'] = '1010'
	dd['-'] = '1011'
	dd['.'] = '1100'
	dd[','] = '1101'
	dd['['] = '1110'
	dd[']'] = '1111'
	s = readstr()
	ans = ''
	for i in s:
		ans += dd[i]
	print(int(ans, 2) % (int(1000000.0) + 3))

def main():
	t = 1
	for _ in range(t):
		solve()
main()


def reverse(s):
	str = ''
	for i in s:
		str = i + str
	return str
s = str(input(''))
s1 = ''
for i in s:
	if i is '>':
		s1 = s1 + '1000'
	if i is '<':
		s1 = s1 + '1001'
	if i is '+':
		s1 = s1 + '1010'
	if i is '-':
		s1 = s1 + '1011'
	if i is '.':
		s1 = s1 + '1100'
	if i is ',':
		s1 = s1 + '1101'
	if i is '[':
		s1 = s1 + '1110'
	if i is ']':
		s1 = s1 + '1111'
s1 = reverse(s1)
ans = 0
for i in range(len(s1)):
	if s1[i] is '1':
		ans = ans + 2 ** i
print(ans % 1000003)


s = input()
ans = ''
for i in range(0, len(s)):
	if s[i] == '>':
		ans = ans + '1000'
	elif s[i] == '<':
		ans = ans + '1001'
	elif s[i] == '+':
		ans = ans + '1010'
	elif s[i] == '-':
		ans = ans + '1011'
	elif s[i] == '.':
		ans = ans + '1100'
	elif s[i] == ',':
		ans = ans + '1101'
	elif s[i] == '[':
		ans = ans + '1110'
	elif s[i] == ']':
		ans = ans + '1111'
sum = 0
c = 0
for i in range(len(ans) - 1, -1, -1):
	sum += int(ans[i]) * pow(2, c)
	c += 1
print(sum % 1000003)


def binary_to_decimal(s):
	l = list(s)
	for i in range(len(l)):
		l[i] = int(l[i])
	d = 0
	for i in range(len(l) - 1, -1, -1):
		d1 = 2 ** (len(l) - 1 - i)
		d = d + l[i] * d1
	return d % 1000003
symbol = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
a = input()
s = ''
for i in a:
	if i in symbol:
		s = s + symbol[i]
print(binary_to_decimal(s))


s = input()
r = ''
for l in s:
	if l == '>':
		r += '1000'
	if l == '<':
		r += '1001'
	if l == '+':
		r += '1010'
	if l == '-':
		r += '1011'
	if l == '.':
		r += '1100'
	if l == ',':
		r += '1101'
	if l == '[':
		r += '1110'
	if l == ']':
		r += '1111'
print(int(r, 2) % 1000003)


n = input()
str = ''
for i in n:
	if i == '>':
		str += '1000'
	elif i == '<':
		str += '1001'
	elif i == '+':
		str += '1010'
	elif i == '-':
		str += '1011'
	elif i == '.':
		str += '1100'
	elif i == ',':
		str += '1101'
	elif i == '[':
		str += '1110'
	elif i == ']':
		str += '1111'
print(int(str, 2) % 1000003)


p = input()
unary = ''
for item in p:
	if item == '>':
		unary += '1000'
	if item == '<':
		unary += '1001'
	if item == '+':
		unary += '1010'
	if item == '-':
		unary += '1011'
	if item == '.':
		unary += '1100'
	if item == ',':
		unary += '1101'
	if item == '[':
		unary += '1110'
	if item == ']':
		unary += '1111'
i = -1
decimal = 0
while abs(i) <= len(unary):
	if unary[i] == '1':
		decimal += 2 ** (abs(i) - 1)
	i -= 1
print(decimal % 1000003)


t = input()
count = 0
q = dict()
q['>'] = '1000'
q['<'] = '1001'
q['+'] = '1010'
q['-'] = '1011'
q['.'] = '1100'
q[','] = '1101'
q['['] = '1110'
q[']'] = '1111'

def chlen(s):
	b = ''
	for i in range(len(s)):
		if s[i] in q:
			b += q.get(s[i])
	return b
f = chlen(t)
for i in range(len(f)):
	count += int(f[i]) * 2 ** (len(f) - i - 1)
print(int(count % 1000003))


x = input()
y = ''
for i in range(0, len(x)):
	if x[i] == '>':
		y += str(1000)
	elif x[i] == '<':
		y += str(1001)
	elif x[i] == '+':
		y += str(1010)
	elif x[i] == '-':
		y += str(1011)
	elif x[i] == '.':
		y += str(1100)
	elif x[i] == ',':
		y += str(1101)
	elif x[i] == '[':
		y += str(1110)
	elif x[i] == ']':
		y += str(1111)
out = 0
siz = len(y) - 1
for i in range(0, len(y)):
	if y[i] == '1':
		out += 2 ** siz
	siz -= 1
print(out % 1000003)


s = input()
s1 = ''
for x in s:
	if x == '>':
		s1 += '1000'
	if x == '<':
		s1 += '1001'
	if x == '+':
		s1 += '1010'
	if x == '-':
		s1 += '1011'
	if x == '.':
		s1 += '1100'
	if x == ',':
		s1 += '1101'
	if x == '[':
		s1 += '1110'
	if x == ']':
		s1 += '1111'
print(int(s1, 2) % 1000003)


x = input()
a = [['>', '1000'], ['<', '1001'], ['+', '1010'], ['-', '1011'], ['.', '1100'], [',', '1101'], ['[', '1110'], [']', '1111']]
s = ''
for i in range(len(x)):
	for j in range(len(a)):
		if a[j][0] == x[i]:
			s += a[j][1]
print(int(s, 2) % 1000003)


s = str(input())
bin = ''
for i in range(len(s)):
	if s[i] == '>':
		bin += '1000'
	if s[i] == '<':
		bin += '1001'
	if s[i] == '+':
		bin += '1010'
	if s[i] == '-':
		bin += '1011'
	if s[i] == '.':
		bin += '1100'
	if s[i] == ',':
		bin += '1101'
	if s[i] == '[':
		bin += '1110'
	if s[i] == ']':
		bin += '1111'
print(int(bin, 2) % 1000003)


sign = ['>', '<', '+', '-', '.', ',', '[', ']']
value = [1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111]
value = map(str, value)
k = dict(zip(sign, value))
a = input()
ans = ''
for i in a:
	if i in k:
		ans += k[i]
result = 0
ans = ans[::-1]
for i in range(len(ans)):
	result += int(ans[i]) * 2 ** i
print(result % 1000003)


s = input()
n = ''
for i in range(len(s)):
	if s[i] == '>':
		n = n + '1000'
	elif s[i] == '<':
		n = n + '1001'
	elif s[i] == '+':
		n = n + '1010'
	elif s[i] == '-':
		n = n + '1011'
	elif s[i] == '.':
		n = n + '1100'
	elif s[i] == ',':
		n = n + '1101'
	elif s[i] == '[':
		n = n + '1110'
	elif s[i] == ']':
		n = n + '1111'
print(int(n, 2) % 1000003)


p = input()
s = ''
ans = 0
for i in range(len(p)):
	if p[i] == '+':
		s = s + '1010'
	elif p[i] == '-':
		s = s + '1011'
	elif p[i] == '>':
		s = s + '1000'
	elif p[i] == '<':
		s = s + '1001'
	elif p[i] == '[':
		s = s + '1110'
	elif p[i] == ']':
		s = s + '1111'
	elif p[i] == '.':
		s = s + '1100'
	elif p[i] == ',':
		s = s + '1101'
a = list(s)
a.reverse()
for i in range(len(a)):
	ans = ans + int(a[i]) * pow(2, i)
print(ans % 1000003)


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def int1():
	return int(input())
import string

def main():
	s = input()
	s1 = ''
	for x in s:
		if x == '>':
			s1 += '1000'
		elif x == '<':
			s1 += '1001'
		elif x == '+':
			s1 += '1010'
		elif x == '-':
			s1 += '1011'
		elif x == '.':
			s1 += '1100'
		elif x == ',':
			s1 += '1101'
		elif x == '[':
			s1 += '1110'
		elif x == ']':
			s1 += '1111'
	print(int(s1, 2) % 1000003)
main()


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 1000003
s = input()
ans = ''
for i in s:
	if i == '>':
		ans += '1000'
	if i == '<':
		ans += '1001'
	if i == '+':
		ans += '1010'
	if i == '-':
		ans += '1011'
	if i == '.':
		ans += '1100'
	if i == '[':
		ans += '1110'
	if i == ',':
		ans += '1101'
	if i == ']':
		ans += '1111'
print(int(ans, 2) % mod)


import math
from collections import defaultdict
ml = lambda : map(int, input().split())
ll = lambda : list(map(int, input().split()))
ii = lambda : int(input())
ip = lambda : input()
t = 1
mod = 1000000.0 + 3
for _ in range(t):
	d = defaultdict(str)
	d['>'] = '1000'
	d['<'] = '1001'
	d['+'] = '1010'
	d['-'] = '1011'
	d['.'] = '1100'
	d[','] = '1101'
	d['['] = '1110'
	d[']'] = '1111'
	s = ip()
	ans = ''
	s = list(s)
	for i in s:
		ans += d[str(i)]
	ans = ans[::-1]
	val = 0
	for i in range(len(ans)):
		if ans[i] == '1':
			val += pow(2, i) % mod
			val %= mod
	print(int(val))


def solve(a):
	x = 0
	y = len(a)
	for i in a:
		x = x + int(i) * 2 ** (y - 1)
		y = y - 1
	return x % 1000003
p = input()
x = ''
for i in p:
	if i == '>':
		x = x + '1000'
	elif i == '<':
		x = x + '1001'
	elif i == '+':
		x = x + '1010'
	elif i == '-':
		x = x + '1011'
	elif i == '.':
		x = x + '1100'
	elif i == ',':
		x = x + '1101'
	elif i == '[':
		x = x + '1110'
	elif i == ']':
		x = x + '1111'
print(solve(x))


s = str(input(''))
A = ''
for i in s:
	if i == '>':
		A += '1000'
	if i == '<':
		A += '1001'
	if i == '+':
		A += '1010'
	if i == '-':
		A += '1011'
	if i == '.':
		A += '1100'
	if i == ',':
		A += '1101'
	if i == '[':
		A += '1110'
	if i == ']':
		A += '1111'
A = '0b' + A
A = int(A, 2)
print(A % 1000003)


s = input()
wd = ''
for i in s:
	if i == '>':
		wd += '1000'
	elif i == '<':
		wd += '1001'
	elif i == '+':
		wd += '1010'
	elif i == '-':
		wd += '1011'
	elif i == '.':
		wd += '1100'
	elif i == ',':
		wd += '1101'
	elif i == '[':
		wd += '1110'
	elif i == ']':
		wd += '1111'
mod = 10 ** 6 + 3
p = 0
sum = 0
for i in range(len(wd) - 1, -1, -1):
	ch = int(wd[i])
	power = 1 << p
	p += 1
	sum += ch * power
print(sum % mod)


def ans(s):
	sum = 0
	for i in range(0, len(s), 1):
		c = s[i]
		if c.isupper():
			sum += 1
	return sum
s = str(input())
l = len(s)
x = ''
for i in range(0, l, 1):
	if s[i] == '>':
		x += '1000'
	elif s[i] == '<':
		x += '1001'
	elif s[i] == '+':
		x += '1010'
	elif s[i] == '-':
		x += '1011'
	elif s[i] == '.':
		x += '1100'
	elif s[i] == ',':
		x += '1101'
	elif s[i] == '[':
		x += '1110'
	elif s[i] == ']':
		x += '1111'
f = int(x, 2)
print(f % 1000003)


k = ''
for i in input().strip():
	if i == '<':
		k += '1001'
	elif i == '>':
		k += '1000'
	elif i == '+':
		k += '1010'
	elif i == '-':
		k += '1011'
	elif i == '.':
		k += '1100'
	elif i == ',':
		k += '1101'
	elif i == '[':
		k += '1110'
	elif i == ']':
		k += '1111'
print(int(k, 2) % 1000003)


s = input()
n = ''
for s in s:
	temp = ''
	if s == '>':
		temp = '1000'
	elif s == '<':
		temp = '1001'
	elif s == '+':
		temp = '1010'
	elif s == '-':
		temp = '1011'
	elif s == '.':
		temp = '1100'
	elif s == ',':
		temp = '1101'
	elif s == '[':
		temp = '1110'
	elif s == ']':
		temp = '1111'
	n += temp
b = int(n, 2)
print(b % (10 ** 6 + 3))


import time
import io
import math
import random

def timer(f):

	def tmp(*args, **kwargs):
		t = time.time()
		res = f(*args, **kwargs)
		print('Time : %f' % (time.time() - t))
		return res
	return tmp

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def f(a, b):
	return Value(gcd(a.val, b.val))

class Value:
	val = 0

	def __init__(self, val):
		self.val = val

	def __str__(self):
		return str(self.val)

	@staticmethod
	def zero():
		return Value(1)

	@staticmethod
	def dif(a, b):
		return Value(a.val - b.val)

class BinaryTree:
	leftChild = None
	rightChild = None
	value = None
	left = 0
	right = 0

	def __init__(self, left, right, value, leftBound, rightBound):
		self.leftChild = left
		self.rightChild = right
		self.value = value
		self.left = leftBound
		self.right = rightBound

	def print(self, indent):
		if self.leftChild == None:
			return str(self.value) + ' (' + str(self.left) + ' - ' + str(self.right) + ')'
		else:
			sleft = self.leftChild.print(indent + 1)
			sright = self.rightChild.print(indent + 1)
			return str(self.value) + ' (' + str(self.left) + ' - ' + str(self.right) + ')' + '\n' + '   ' * indent + sleft + '\n' + '   ' * indent + sright

	@staticmethod
	def build(array, left, right, f):
		if left == right:
			return BinaryTree(None, None, array[left], left, right)
		else:
			middle = (left + right) // 2
			leftTree = BinaryTree.build(array, left, middle, f)
			rightTree = BinaryTree.build(array, middle + 1, right, f)
			value = f(leftTree.value, rightTree.value)
			return BinaryTree(leftTree, rightTree, value, left, right)

	def query(self, fr, to, f):
		if fr > to:
			return Value.zero()
		if self.left == fr and self.right == to:
			return self.value
		else:
			middle = (self.left + self.right) // 2
			leftVal = self.leftChild.query(fr, min(middle, to), f)
			rightVal = self.rightChild.query(max(middle + 1, fr), to, f)
			return f(leftVal, rightVal)

	def modify(self, index, newValue, f):
		dif = Value.dif(newValue, self.query(index, index, f))
		if index == self.left and index == self.right:
			self.value = newValue
		else:
			middle = (self.left + self.right) // 2
			self.value = f(self.value, dif)
			if index <= middle:
				self.leftChild.modify(index, newValue, f)
			else:
				self.rightChild.modify(index, newValue, f)

@timer
def use():
	array = []
	array.append(Value(4))
	array.append(Value(6))
	array.append(Value(12))
	array.append(Value(4))
	segmentTree = BinaryTree.build(array, 0, len(array) - 1, f)
	print(segmentTree.print(1))
	print(segmentTree.query(1, 3, f))
	segmentTree.modify(3, Value(5), f)
	print(segmentTree.print(1))
	print(segmentTree.query(1, 3, f))
str = input()
dv = ''
for i in range(len(str)):
	if str[i] == '>':
		dv += '1000'
	if str[i] == '<':
		dv += '1001'
	if str[i] == '+':
		dv += '1010'
	if str[i] == '-':
		dv += '1011'
	if str[i] == '.':
		dv += '1100'
	if str[i] == ',':
		dv += '1101'
	if str[i] == '[':
		dv += '1110'
	if str[i] == ']':
		dv += '1111'
summ = 0
for i in range(len(dv)):
	if dv[i] == '1':
		summ += 2 ** (len(dv) - i - 1)
print(summ % 1000003)


x = list(input())
a = ''
for i in x:
	if i == '>':
		a += '1000'
	elif i == '<':
		a += '1001'
	elif i == '+':
		a += '1010'
	elif i == '-':
		a += '1011'
	elif i == '.':
		a += '1100'
	elif i == ',':
		a += '1101'
	elif i == '[':
		a += '1110'
	elif i == ']':
		a += '1111'
y = int(a)
(decimal, i, n) = (0, 0, 0)
while y != 0:
	dec = y % 10
	decimal = decimal + dec * pow(2, i)
	y = y // 10
	i += 1
print(decimal % 1000003)


string = input()
x = ''
for char in string:
	if char == '>':
		x += str(1000)
	elif char == '<':
		x += str(1001)
	elif char == '+':
		x += str(1010)
	elif char == '-':
		x += str(1011)
	elif char == '.':
		x += str(1100)
	elif char == ',':
		x += str(1101)
	elif char == '[':
		x += str(1110)
	elif char == ']':
		x += str(1111)
binary = int(x, 2)
print(binary % 1000003)


s = list(input())
a = ''
for i in s:
	if i == '>':
		a += '1000'
	if i == '<':
		a += '1001'
	if i == '+':
		a += '1010'
	if i == '-':
		a += '1011'
	if i == '.':
		a += '1100'
	if i == ',':
		a += '1101'
	if i == '[':
		a += '1110'
	if i == ']':
		a += '1111'
print(int(a, 2) % 1000003)


s = input()
b = ''
for c in s:
	if c == '>':
		b += '1000'
	if c == '<':
		b += '1001'
	if c == '+':
		b += '1010'
	if c == '-':
		b += '1011'
	if c == '.':
		b += '1100'
	if c == ',':
		b += '1101'
	if c == '[':
		b += '1110'
	if c == ']':
		b += '1111'
print(int(b, 2) % 1000003)


a = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
k = ''
for x in list(input()):
	if x in a:
		k += a[x]
t = int(k, 2)
print(t % 1000003)


t = input()
s = ''
m = 10 ** 6 + 3
dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in range(len(t)):
	if t[i] == '>':
		s += dic['>']
	elif t[i] == '<':
		s += dic['<']
	elif t[i] == '+':
		s += dic['+']
	elif t[i] == '-':
		s += dic['-']
	elif t[i] == '.':
		s += dic['.']
	elif t[i] == ',':
		s += dic[',']
	elif t[i] == '[':
		s += dic['[']
	elif t[i] == ']':
		s += dic[']']
l = len(s)
sum = 0
for i in range(l):
	sum += int(s[i]) * 2 ** (l - i - 1)
	sum = sum % m
print(sum)


dicts = {}
dicts['>'] = '1000'
dicts['<'] = '1001'
dicts['+'] = '1010'
dicts['-'] = '1011'
dicts['.'] = '1100'
dicts[','] = '1101'
dicts['['] = '1110'
dicts[']'] = '1111'
ans = []
strs = input()
for i in strs:
	if i in dicts:
		ans.append(dicts[i])
totalstring = ''.join(ans)
kk = int(totalstring, 2) % 1000003
print(kk)