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
Tags: Implementation

Starter code:

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)


def binaryToDecimal(n):
	return int(n, 2)
dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
res = ''
s = input()
for i in s:
	res += dic[i]
print(binaryToDecimal(res) % 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()
import math
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
e = ''
for i in s:
	e += d[i]
print(int(e, 2) % 1000003)


brainf = input()
brainf = brainf.replace('>', '1000')
brainf = brainf.replace('<', '1001')
brainf = brainf.replace('+', '1010')
brainf = brainf.replace('-', '1011')
brainf = brainf.replace('.', '1100')
brainf = brainf.replace(',', '1101')
brainf = brainf.replace('[', '1110')
brainf = brainf.replace(']', '1111')
dec_num = 0
Rank = 0
e = len(brainf) - 1
while e >= 0:
	dec_num += int(brainf[e]) * 2 ** Rank
	Rank += 1
	e -= 1
print(dec_num % 1000003)


mp = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
s = input()
u = [str(mp[c]) for c in s]
print(int(''.join(u), 2) % (10 ** 6 + 3))


s = str(input())
d = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
l = len(s)
ans = 0
p = 1
for i in range(0, l):
	ans += p * d[s[l - i - 1]] % 1000003
	p *= 16
print(ans % 1000003)


p = {}
p['>'] = 8
p['<'] = 9
p['+'] = 10
p['-'] = 11
p['.'] = 12
p[','] = 13
p['['] = 14
p[']'] = 15
t = input()
ans = 0
for i in t:
	ans = 16 * ans + p[i]
print(ans % 1000003)


s = input()
mp = {}
mp['>'] = '1000'
mp['<'] = '1001'
mp['+'] = '1010'
mp['-'] = '1011'
mp['.'] = '1100'
mp[','] = '1101'
mp['['] = '1110'
mp[']'] = '1111'
res = 0
ans = ''
mod = 10 ** 6 + 3
for i in range(len(s) - 1, -1, -1):
	temp = mp[s[i]]
	temp += ans
	res = (res + int(temp, 2) % mod) % mod
	ans += '0000'
print(res)


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 sys
inf = float('inf')

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

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

def input():
	return sys.stdin.readline().strip()
string = input()
mydict = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
ct = ''
for i in string:
	ct += str(mydict[i])
ans = int(ct, 2)
ans %= 10 ** 6 + 3
print(ans)


L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
x = input()
a = ''
y = 0
c = 0
for i in x:
	y += 4
	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'
	else:
		a += '1111'
for i in range(y):
	if a[i] == '1':
		c += 2 ** (y - 1)
	y -= 1
print(c % 1000003)


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()


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


s = input()

def res(a, b):
	b = b - 4
	c = 0
	for k in range(1, 5):
		c += int(a[-k]) * 2 ** (k + b - 1)
	return c
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
suma = 0
i = len(s) * 4
for k in s:
	suma += res(d[k], i)
	i -= 4
print(suma % 1000003)


MOD = 10 ** 6 + 3
inst_to_bin = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
code = input()
bin_code = ''
for c in code:
	bin_code += inst_to_bin[c]
result = 0
base = 1
for c in reversed(bin_code):
	result = (result + int(c) * base) % MOD
	base *= 2
print(result)


def func(x, number):
	a = {'>': (1, 0, 0, 0), '<': (1, 0, 0, 1), '+': (1, 0, 1, 0), '-': (1, 0, 1, 1), '.': (1, 1, 0, 0), ',': (1, 1, 0, 1), '[': (1, 1, 1, 0), ']': (1, 1, 1, 1)}
	number = int(4 * number)
	num = a[x]
	total = 0
	for i in range(0, 4):
		total = total + num[4 - i - 1] * 2 ** (number + i)
	return total
x = input()
x = list(x)
for i in range(0, int(len(x) / 2)):
	t = x[i]
	x[i] = x[len(x) - i - 1]
	x[len(x) - i - 1] = t
total = 0
for i in range(0, len(x)):
	total = total + func(x[i], i)
	total = total % 1000003
print(total)


conv = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
s = 0
for c in input():
	s *= 16
	s += conv[c]
	s %= 1000003
print(s)


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


g = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input().rstrip()
ans = ''
for i in s:
	ans += g[i]
print(int(ans, 2) % (10 ** 6 + 3))


print(int(input().replace('>', '1000').replace('<', '1001').replace('+', '1010').replace('-', '1011').replace('.', '1100').replace(',', '1101').replace('[', '1110').replace(']', '1111'), base=2) % (10 ** 6 + 3))


s = input()
dt = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
cat = ''
for p in s:
	cat += str(dt[p])
cat = cat[::-1]
ans = 0
for i in range(len(cat)):
	ans += 2 ** i * int(cat[i])
print(ans % 1000003)


(d, final) = ({'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}, '')
for char in input():
	final += d[char]
print(int(final, 2) % 1000003)


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)


d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input()
l = []
for i in s:
	l.append(d[i])
a = ''.join(l)
ans = int(a, 2)
print(ans % 1000003)


print(int(''.join(({'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}[_] for _ in input())), 2) % 1000003)


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


s = input()
s = s.replace('>', '1000')
s = s.replace('<', '1001')
s = s.replace('+', '1010')
s = s.replace('-', '1011')
s = s.replace('.', '1100')
s = s.replace(',', '1101')
s = s.replace('[', '1110')
s = s.replace(']', '1111')
print(int(s, 2) % 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)


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return '\n'.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
MOD = 10 ** 6 + 3
p = input()
s = ''
for c in p:
	s += d[c]
print(int(s, base=2) % MOD)


def language(string):
	dct = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
	ans = ''
	for i in string:
		ans += str(dct[i])
	return int(ans, 2) % 1000003
print(language(input()))


s = input()
ans_bin = ''
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in range(len(s)):
	ans_bin += d[s[i]]
ans = 0
j = -1
while j != -len(ans_bin) - 1:
	ans += int(ans_bin[j]) * 2 ** (abs(j) - 1)
	j -= 1
print(ans % (10 ** 6 + 3))


def main():
	from sys import stdin, stdout
	dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
	s = stdin.readline().strip()
	t = ''
	for i in s:
		t += dic[i]
	num = int(t, 2)
	stdout.write(str(num % (int(1000000.0) + 3)))
main()


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


d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
ans = c = 0
for i in input()[::-1]:
	for j in d[i][::-1]:
		ans += 2 ** c * int(j)
		c += 1
print(ans % 1000003)


d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
str = ''.join([d[c] for c in input()])
(res, b) = (0, 1)
for i in range(len(str))[::-1]:
	if str[i] == '1':
		res += b
	b *= 2
print(res % 1000003)


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)

def binaryToDecimal(n):
	return int(n, 2)
a = ['>', '<', '+', '-', '.', ',', '[', ']']
b = ['1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111']
s = list(str(input()))
s1 = ''
for i in range(len(s)):
	s1 = s1 + b[a.index(s[i])]
print(binaryToDecimal(s1) % 1000003)


import sys
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod2 = 998244353

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

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
s = data()
dp = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
j = 0
answer = 0
mod = int(pow(10, 6)) + 3
for i in range(len(s) - 1, -1, -1):
	temp = dp[s[i]]
	for k in range(len(temp) - 1, -1, -1):
		answer += int(temp[k]) * int(pow(2, j))
		answer %= mod
		j += 1
out(str(answer))


op = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
binstr = ''.join(list(map(lambda c: op[c], str(input()))))
base = 1000003
ans = 0
for (j, i) in enumerate(binstr, 0):
	h = len(binstr) - j - 1
	ret = 1
	for k in range(0, h):
		ret *= 2
		ret %= base
	ans += (1 if i == '1' else 0) * ret
	ans %= base
print(ans)


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


unary = input()
unary_dict = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
unary_list = []
for i in range(0, len(unary)):
	unary_list.append(unary_dict[unary[i]])
unary_list = list(map(str, unary_list))
unary_list = ''.join(unary_list)
temp = 0
for j in range(len(unary_list), 0, -1):
	temp = temp + int(unary_list[j - 1]) * 2 ** (len(unary_list) - j)
print(temp % (10 ** 6 + 3))


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()
m = {}
m['>'] = '1000'
m['<'] = '1001'
m['+'] = '1010'
m['-'] = '1011'
m['.'] = '1100'
m[','] = '1101'
m['['] = '1110'
m[']'] = '1111'
res = ''
for ch in s:
	res += m[ch]
print(int(res, 2) % (10 ** 6 + 3))


p = input()
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for x in d:
	p = p.replace(x, d[x])
l = 0
for x in range(len(p)):
	l += int(p[x]) * 2 ** (len(p) - x - 1)
print(l % (10 ** 6 + 3))


def rr():
	return input().rstrip()

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))
from collections import defaultdict

def mus(d=0):
	return defaultdict(defaultdict(d))

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def yn(x):
	return 'YES' if x else 'NO'
from itertools import accumulate
from itertools import groupby

def grp(x):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def read():
	return (rr(),)

def solve(s):
	tp = {'>': (1, 0, 0, 0), '<': (1, 0, 0, 1), '+': (1, 0, 1, 0), '-': (1, 0, 1, 1), '.': (1, 1, 0, 0), ',': (1, 1, 0, 1), '[': (1, 1, 1, 0), ']': (1, 1, 1, 1)}
	md = 10 ** 6 + 3
	x = [tp[ch] for ch in s]
	x = [i for sub in x for i in sub]
	x = list(reversed(x))
	cs = 0
	for (num, i) in enumerate(x):
		cs = (cs + i * 2 ** num) % md
	ans = cs
	return ans
test_count = 1
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


mod = 1000003
d = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
s = input()
ans = 0
for c in s:
	ans = (ans * 16 + d[c]) % mod
print(ans)


f = ''
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in input():
	f += d[i]
print(int(f, 2) % (10 ** 6 + 3))


g = input()
result = ''
dic = {}
count = 0
dic = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
for i in range(len(g)):
	count += 4
	result += str(dic[g[i]])
answer = 0
for i in range(count):
	if result[count - 1 - i] == '1':
		answer += 2 ** i
print(answer % 1000003)


s = input()
dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
l = []
for i in s:
	l.append(dict[i])
print(int(''.join(l), 2) % 1000003)


from functools import reduce
print(reduce(lambda x, y: (x * 16 + y) % 1000003, map(lambda c: '><+-.,[]'.find(c) + 8, input()), 0))


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


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)


s = input()
brainfuck = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
ans = 0
for i in s:
	ans = ans * 16 + brainfuck[i]
print(ans % 1000003)


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


mod = 1000003
prog = input()
res = 0
for c in prog:
	res *= 16
	res %= mod
	if c == '>':
		res += 8
	elif c == '<':
		res += 9
	elif c == '+':
		res += 10
	elif c == '-':
		res += 11
	elif c == '.':
		res += 12
	elif c == ',':
		res += 13
	elif c == '[':
		res += 14
	elif c == ']':
		res += 15
print(res % mod)


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


from sys import *
from math import *
from sys import stdin, stdout
from collections import *
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
s = str(input())
dic = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
st = ''
for i in s:
	st += str(dic[i])
print(int(st, 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)


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


import sys
import os
from io import IOBase, BytesIO
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def main():
	s = sin()
	dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
	ans = ''
	for c in s:
		ans += dict.get(c)
	print(int(ans, 2) % 1000003)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


def readln():
	return tuple(map(int, input().split()))
m = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
ans = 0
mod = 10 ** 6 + 3
for (i, c) in enumerate(reversed(list(input()))):
	ans = (ans + (m[c] << 4 * i)) % mod
print(ans)


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


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


com = input()
l = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
for i in com:
	com = com.replace(i, str(l[i]))
s = int(com, base=2) % 1000003
print(s)


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


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


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

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

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
d = {}
d['>'] = '1000'
d['<'] = '1001'
d['+'] = '1010'
d['-'] = '1011'
d['.'] = '1100'
d[','] = '1101'
d['['] = '1110'
d[']'] = '1111'
x = ''
s = input()
for i in range(len(s)):
	x += d[s[i]]
x = x[::-1]
p = 0
mod = 10 ** 6 + 3
ans = 0
for c in x:
	if c == '1':
		ans += pow(2, p, mod)
		ans %= mod
	p += 1
print(ans)
endtime = time.time()


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))


n = input()
dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
list = []
for a in n:
	list.append(dict[a])
s = ''.join(list)
s = int(s, 2)
print(s % 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)


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


s = input()
res = '0b'
brainfuck = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for ch in s:
	res += brainfuck[ch]
print(int(res, 2) % 1000003)


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


prog = input()
coms = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
num = '0b'
for i in prog:
	num += coms[i]
print(int(num, 2) % (10 ** 6 + 3))


from functools import reduce
__author__ = 'asmn'
trans = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
print(reduce(lambda x, y: x * 2 + int(y), ''.join(map(lambda c: trans[c], input())), 0) % 1000003)


a = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
s1 = input()
for i in s1:
	s1 = s1.replace(i, str(a[i]))
print(int(s1, 2) % 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)


d = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
a = 0
for c in input():
	a *= 16
	a += d[c]
	a %= 1000003
print(a)


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 = input()
MOD = 10 ** 6 + 3
d = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
ans = ''
for i in s:
	ans += str(d[i])
ans = int(ans, 2)
print(ans % MOD)


d = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
x = 0
m = 10 ** 6 + 3
for i in input():
	x = (16 * x % m + d[i]) % m
print(x)


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)


def string_for_char(st):
	if st == '>':
		return '1000'
	elif st == '<':
		return '1001'
	elif st == '+':
		return '1010'
	elif st == '-':
		return '1011'
	elif st == '.':
		return '1100'
	elif st == ',':
		return '1101'
	elif st == '[':
		return '1110'
	else:
		return '1111'
st = list(input())
string = ''
for i in st:
	string = string + string_for_char(i)
print(int(string, 2) % 1000003)


d = dict(zip('><+-.,[]', '1000 1001 1010 1011 1100 1101 1110 1111'.split()))
print(int(''.join(map(d.get, input())), 2) % 1000003)


d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input()
ans = ''
for i in s:
	ans += d[i]
cur = 0
p = 1
for i in ans[::-1]:
	if i == '1':
		cur += p
		cur = cur % 1000003
	p *= 2
print(cur)


def main(s):
	m = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
	d = ''
	for c in s:
		d += m[c]
	return int(d, 2) % int(1000000.0 + 3)
print(main(input()))


def Decimal(s):
	n = len(s)
	x = 0
	for i in range(n):
		x += int(s[n - 1 - i]) * 2 ** i
	return x
f = ''
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in input():
	f += d[i]
print(Decimal(f) % 1000003)


string1 = str(input())
dictionaries = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
l = []
for i in string1:
	l.append(dictionaries[i])
nr = int()
poz = 0
rest = int(1000000.0 + 3)
for j in l[::-1]:
	while j:
		nr += j % 10 * pow(2, poz)
		nr %= rest
		poz += 1
		j //= 10
print(int(nr))


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


t = input()
k = ['>', '<', '+', '-', '.', ',', '[', ']']
sumn = 0
p = len(t)
for i in range(p):
	sumn += (8 + k.index(t[i])) * 16 ** (p - 1 - i)
print(sumn % 1000003)


mapa = dict()
mapa['>'] = '1000'
mapa['<'] = '1001'
mapa['+'] = '1010'
mapa['-'] = '1011'
mapa['.'] = '1100'
mapa[','] = '1101'
mapa['['] = '1110'
mapa[']'] = '1111'
a = input()
res = ''
for c in a:
	res += mapa[c]
print(int(res, 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)


l = ['>', '<', '+', '-', '.', ',', '[', ']']
l1 = ['1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111']
s = input()
a = ''
for i in s:
	a = a + l1[l.index(i)]
d = int(a, 2)
print(d % 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)


conv = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}

def toBin(s):
	t = reversed(''.join([conv[i] for i in s]))
	return t

def toInt(s):
	ans = 0
	for (index, key) in enumerate(s):
		k = pow(2, index, int(1000000.0 + 3)) * int(key)
		ans += k
		ans = ans % int(1000000.0 + 3)
	return ans
s = input()
print(toInt(toBin(s)))


def take_input():
	inpt = input()
	return inpt

def main():
	inpt = take_input()
	cmd_list = ['>', '<', '+', '-', '.', ',', '[', ']']
	bin_list = ['1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111']
	bin_num = ''
	for i in inpt:
		idx = cmd_list.index(i)
		bin_num += bin_list[idx]
	num = int(bin_num, 2)
	num %= 1000003
	print(num)
main()


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)


str = input()
str = str.replace('>', '1000')
str = str.replace('<', '1001')
str = str.replace('+', '1010')
str = str.replace('-', '1011')
str = str.replace('.', '1100')
str = str.replace(',', '1101')
str = str.replace('[', '1110')
str = str.replace(']', '1111')
x = int(str, 2)
print(x % 1000003)


import sys

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

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
A = input()
str = ''
for a in A:
	str += dict[a]
print(int(str, 2) % 1000003)


mod = 1000003
unary_dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
code = ''.join((unary_dict[c] for c in input()))[::-1]
ans = 0
for (i, d) in enumerate(code):
	if d == '1':
		ans += pow(2, i, mod)
print(ans % mod)


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()


import os
dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
r = input()
ans = ''
for i in range(len(r)):
	ans += dict[r[i]]
b = int(ans, 2)
print(b % (1000000 + 3))


def binToDec(bi):
	dec = 0
	base = 1
	for i in range(len(bi) - 1, -1, -1):
		if bi[i] == '1':
			dec += base
		base *= 2
	return dec
h = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input()
bin = ''
for i in s:
	bin += h[i]
num = binToDec(bin) % 1000003
print(num)


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


s = input()
tab = []

def func(t):
	if t == '>':
		return '1000'
	if t == '<':
		return '1001'
	if t == '+':
		return '1010'
	if t == '-':
		return '1011'
	if t == '.':
		return '1100'
	if t == ',':
		return '1101'
	if t == '[':
		return '1110'
	if t == ']':
		return '1111'
for i in s:
	tab.append(func(i))
	res = ''.join(tab)
print(int(res, 2) % 1000003)


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)


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000003
d = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
p = is1()
res = ''
for i in p:
	res += str(d[i])
res = res[::-1]
ans = 0
for i in range(len(res)):
	if res[i] == '1':
		ans += 2 ** i
		ans %= mod
print(ans)


s = input()
brainFuck = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
res2 = 0
for char in s:
	res2 = (res2 * 16 + brainFuck[char]) % 1000003
print(res2)


f = ''
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in input():
	f += d[i]
print(int(f, 2) % 1000003)


Soul_Gem = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
Chito = input()
n = len(Chito)
MODoka = 10 ** 6 + 3
modulos = [1]
for i in range(n - 1):
	modulos.append(modulos[i] * 16 % MODoka)
Yuuri = 0
for i in range(n):
	Yuuri += Soul_Gem[Chito[n - 1 - i]] * modulos[i]
	Yuuri = Yuuri % MODoka
print(Yuuri)


a = ['>', '<', '+', '-', '.', ',', '[', ']']
b = [1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111]
s = input()
z = ''
for i in range(0, len(s)):
	p = a.index(s[i])
	z = z + str(b[p])
z = z[::-1]
h = 0
for i in range(0, len(z)):
	if z[i] == '1':
		h = h + 2 ** i
print(h % 1000003)


d = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
s = input()
a = ''
for i in range(len(s)):
	a = a + str(d[s[i]])
a = int(a)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal % 1000003
print(binaryToDecimal(a))


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))


import sys
import math
stra = str(input())
sym = ['>', '<', '+', '-', '.', ',', '[', ']']
val = [8, 9, 10, 11, 12, 13, 14, 15]
abc = stra[::-1]
(suma, k) = (0, 0)
for i in range(len(abc)):
	suma += val[sym.index(abc[i])] * int(pow(2, k))
	k += 4
print(suma % 1000003)


mod = 10 ** 6 + 3
toN = lambda x: ord(x) - ord('0')
s0 = str(input())
s0 = s0.replace('>', '1000')
s0 = s0.replace('<', '1001')
s0 = s0.replace('+', '1010')
s0 = s0.replace('-', '1011')
s0 = s0.replace('.', '1100')
s0 = s0.replace(',', '1101')
s0 = s0.replace('[', '1110')
s0 = s0.replace(']', '1111')
L = list(s0)
L = list(map(toN, L))
for i in range(len(L)):
	L[-i - 1] = L[-i - 1] * 2 ** i
print(sum(L) % mod)


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


def solve():
	m = 10 ** 6 + 3
	p = input()
	p = p.replace('>', '1000')
	p = p.replace('<', '1001')
	p = p.replace('+', '1010')
	p = p.replace('-', '1011')
	p = p.replace('.', '1100')
	p = p.replace(',', '1101')
	p = p.replace('[', '1110')
	p = p.replace(']', '1111')
	x = int(p, 2) % m
	print(x)
solve()


d = dict(zip('><+-.,[]', (bin(x)[2:] for x in range(8, 16))))
print(int(''.join(map(d.get, input())), 2) % 1000003)


b = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
s = input()
constant = 1000003
r = 0
m = 1
for i in range(len(s) - 1, -1, -1):
	r += b[s[i]] * m
	m *= 16
	m %= constant
r %= constant
print(r)


import math
import sys
tail = 48573
mod = 1000003
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = ''
for i in input():
	s += d[i]
res = 0
for (p, i) in enumerate(s):
	if i == '1':
		t = len(s) - p - 1
		r = tail ** (t // 20) * 2 ** (t % 20) % mod
		res += r
print(res % mod)


table = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
ans = 0
for c in input():
	ans = (ans << 4) + table[c]
print(ans % 1000003)


import math

def power(x, y):
	op = 1
	for i in range(1, y + 1):
		op *= 2
		op %= 1000003
	return op
d = {'>': '8', '<': '9', '+': '10', '-': '11', '.': '12', ',': '13', '[': '14', ']': '15'}
s = input()
op = 0
n = len(s)
i = 1
for x in s:
	op += int(d[x]) * power(2, 4 * (n - i)) % 1000003
	op %= 1000003
	i += 1
print(int(op))


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))


line = input()
code = ['><+-.,[]'.index(c) + 8 for c in line]
code.reverse()
(pow, ans) = (0, 0)
for a in code:
	ans += a * 16 ** pow
	pow += 1
print(ans % int(1000000.0 + 3))


bf = input()
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
result = 0
counter = 1
for i in range(len(bf) - 1, -1, -1):
	code = d[bf[i]]
	for j in range(3, -1, -1):
		if code[j] == '1':
			result += counter
		counter *= 2
		counter %= 1000003
print(result % 1000003)


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


dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
p = input()
c = ''
for i in p:
	c += dic[i]
d = int(c, 2)
print(d % (10 ** 6 + 3))


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


def power():
	mem = [1]
	for i in range(400):
		mem.append(2 * mem[i])
	return mem
(mem, sum, tem) = (power(), 0, '')
dic = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
for i in input():
	tem += str(dic[i])
for (i, j) in enumerate(tem[::-1]):
	sum += mem[i] * int(j)
print(sum % 1000003)


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)


bf_prog = str(input())
dyl = ''
int_list = []
int_dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
for i in bf_prog:
	int_list.append(int_dict[i])
for i in int_list:
	dyl += i
dyl = str(dyl)
print(int(dyl, 2) % 1000003)


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


s = str(input())
p = 1
mul = 16
MOD = 10 ** 6 + 3
i = len(s) - 1
ans = 0
while i >= 0:
	if s[i] == '>':
		ans += p * 8
	if s[i] == '<':
		ans += p * 9
	if s[i] == '+':
		ans += p * 10
	if s[i] == '-':
		ans += p * 11
	if s[i] == '.':
		ans += p * 12
	if s[i] == ',':
		ans += p * 13
	if s[i] == '[':
		ans += p * 14
	if s[i] == ']':
		ans += p * 15
	p *= mul
	i -= 1
print(ans % MOD)


s = input()
switch = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
ss = ''
for i in range(len(s)):
	ss += switch.get(s[i])
ss = int(ss, 2)
print(ss % 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)


n = input()
l = ''
d = 0
j = 0
for i in range(len(n)):
	if n[i] == '>':
		l = l + '1000'
	elif n[i] == '<':
		l = l + '1001'
	elif n[i] == '+':
		l = l + '1010'
	elif n[i] == '-':
		l = l + '1011'
	elif n[i] == '.':
		l = l + '1100'
	elif n[i] == ',':
		l = l + '1101'
	elif n[i] == '[':
		l = l + '1110'
	else:
		l = l + '1111'
for i in range(len(l) - 1, -1, -1):
	b = int(l[i])
	d = d + b * 2 ** j
	j = j + 1
d = d % 1000003
print(d)


from math import *
l = [['>', '1000'], ['<', '1001'], ['+', '1010'], ['-', '1011'], ['.', '1100'], [',', '1101'], ['[', '1110'], [']', '1111']]
s = ''
n = input()
p = len(n)
for i in range(p):
	for j in range(8):
		if n[i] == l[j][0]:
			s = s + l[j][1]
k = 0
for i in range(4 * p):
	if s[4 * p - i - 1] == '1':
		k = k + 2 ** i
x = 1000003
print(k % x)


k = input()
hash = {'>': 1000, '<': 1001, '[': 1110, ']': 1111, ',': 1101, '.': 1100, '+': 1010, '-': 1011}
c = ''
for i in k:
	c += str(hash[i])
print(int(c, 2) % 1000003)


import sys

def get_single_int():
	return int(sys.stdin.readline().strip())

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

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = get_string()
ss = ''
for i in s:
	ss += dic[i]
print(int(ss, 2) % (10 ** 6 + 3))


conv = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = str(input())
con = ''
for i in range(len(s)):
	con += conv[s[i]]
print(int(con, 2) % (10 ** 6 + 3))


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


def up(no):
	if no == int(no):
		return int(no)
	else:
		return int(no + 1)
n = input()
ad = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
ans = 0
for i in n:
	ans = 16 * ans + ad[i]
print(ans % 1000003)


print(int(''.join((bin('><+-.,[]'.index(i) + 8)[2:].rjust(3, '0') for i in input())), 2) % 1000003)


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
from collections import *
setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
p = RS()[0]
m = 1000003
(ans, val) = (0, 1)
s = '><+-.,[]'
di = {s[i]: i + 8 for i in range(len(s))}
for i in range(len(p) - 1, -1, -1):
	ans += val * di[p[i]]
	val = val * 16 % m
print(ans % m)


val = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15.0}
mod = 1000003
s = str(input())
s = s[::-1]
ans = 0
for i in range(len(s)):
	ans += val[s[i]] % mod * pow(2, i * 4, mod) % mod
	ans %= mod
print(int(ans))


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)


MOD = 1000000 + 3
p = input()
bin_num = ''
repl = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
ans = 0
for char in p:
	ans = ((ans << 4) + int(repl[char], 2)) % MOD
print(ans)


(k, n, s, a) = (0, 0, '', {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'})
for i in input():
	s += a[i]
for i in s[::-1]:
	n += int(i) * 2 ** k
	k += 1
print(n % 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))


convTable = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input()
concS = ''
for i in range(len(s)):
	concS += convTable[s[i]]
print(int(concS, 2) % (10 ** 6 + 3))


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


n = list(input())
s = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
num = ''
for i in n:
	num += str(bin(s[i]))[2:6]
print(int(num, 2) % 1000003)


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 = input()
dict = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
num = ''
for i in range(len(x)):
	num += str(dict[x[i]])

def func(num):
	n = len(num)
	ans = 0
	for i in range(n):
		if num[i] == '1':
			ans += 2 ** (n - 1 - i)
	return ans
print(func(num) % 1000003)


import math
s = input()
d = {}
g = ''
d.update({'>': '1000'})
d.update({'<': '1001'})
d.update({'+': '1010'})
d.update({'-': '1011'})
d.update({'.': '1100'})
d.update({',': '1101'})
d.update({'[': '1110'})
d.update({']': '1111'})
for i in range(0, len(s)):
	g += d[s[i]]
res = 0
mod = 1000003
power = len(g) - 1
for i in range(0, len(g)):
	x = int(g[i])
	res += pow(2, power) * x
	power -= 1
res %= mod
print(res)


val = 0
for ch in input():
	val = (val * 16 + '><+-.,[]'.find(ch) + 8) % 1000003
print(val)


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


s = str(input())
k = 0
for i in range(len(s)):
	if s[i] == '>':
		k += 8 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == '<':
		k += 9 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == '+':
		k += 10 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == '-':
		k += 11 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == '.':
		k += 12 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == ',':
		k += 13 * 2 ** (4 * (len(s) - i - 1))
	elif s[i] == '[':
		k += 14 * 2 ** (4 * (len(s) - i - 1))
	else:
		k += 15 * 2 ** (4 * (len(s) - i - 1))
print(k % 1000003)


def Decimal(s):
	n = len(s)
	x = 0
	for i in range(n):
		x += int(s[n - 1 - i]) * 2 ** i
	return x
s = input()
K = {}
K['>'] = '1000'
K['<'] = '1001'
K['+'] = '1010'
K['-'] = '1011'
K['.'] = '1100'
K[','] = '1101'
K['['] = '1110'
K[']'] = '1111'
for item in K:
	s = s.replace(item, K[item])
print(Decimal(s) % 1000003)


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


import re
d = {'>': 1000, '<': 1001, '+': 1010, '.': 1100, '-': 1011, ',': 1101, '[': 1110, ']': 1111}
st = input()
sts = ''
for i in st:
	sts += str(d[i])
n = int(sts, 2)
print(n % (10 ** 6 + 3))


def bintodec(s):
	num = 0
	mod = 1000003
	p = 2
	k = 0
	for i in range(len(s) - 1, -1, -1):
		num += int(s[i]) * p ** k
		k += 1
		num = num % mod
	return num % mod
dic = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = input()
ans = ''
mod = 1000003
for i in range(len(s)):
	ans += dic[s[i]]
print(bintodec(ans))


mlist = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
ans_str = ''
data_str = input()
for c in data_str:
	ans_str += mlist.get(c)
print(int(ans_str, 2) % 1000003)


a = input()
b = ['>', '<', '+', '-', '.', ',', '[', ']']
c = ['0001', '1001', '0101', '1101', '0011', '1011', '0111', '1111']
s = c[b.index(a[len(a) - 1])]
for i in range(len(a) - 2, -1, -1):
	s += c[b.index(a[i])]
j = 0
r = 0
while j <= len(s) - 1:
	if s[j] == '1':
		r += 2 ** j
	j += 1
print(r % 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)


S = input().strip()
M = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
F = ''.join([M[P] for P in S])
print(int(F, 2) % 1000003)


import sys
from bisect import *
from math import floor, sqrt, ceil, factorial as F, gcd, pi
from itertools import chain, combinations, permutations, accumulate
from collections import Counter, defaultdict, OrderedDict, deque
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
mod = 1000003
ch = 'abcdefghijklmnopqrstuvwxyz'
lcm = lambda a, b: a * b // gcd(a, b)
setbit = lambda x: bin(x)[2:].count('1')
INT = lambda type: type(sys.stdin.readline()) if type in [int, float] else type(sys.stdin.readline()).replace('\n', '')
ARRAY = lambda type: list(map(type, sys.stdin.readline().split()))
NUMS = lambda type: map(type, sys.stdin.readline().split())

def solve():
	s = INT(str)
	ans = 0
	d = {'>': 1000, '<': 1001, '+': 1010, '-': 1011, '.': 1100, ',': 1101, '[': 1110, ']': 1111}
	string = ''
	for i in s:
		string += str(d[i])
	print(int(string, 2) % mod)
solve()


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())

def solve():
	pass
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
s = str(input())
ss = ''
for i in s[:-1]:
	ss += d[i]
print(int(ss, 2) % (10 ** 6 + 3))


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))
s = cin()[:-1]
d = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
bin = ''
for ch in s:
	bin += d[ch]
ans = int(bin, 2) % (10 ** 6 + 3)
cout(str(ans))


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)


def main():
	conv = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
	res = 0
	i = 0
	for s in reversed(input()):
		for n in conv[s][::-1]:
			if n == '1':
				res += 2 ** i
			i += 1
	res = res % 1000003
	print(res)
main()


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}
n = list(input())
t = ''
x = []
for i in n:
	x.append(str(a[i]))
d = ''.join(x)
print(int(d, 2) % (10 ** 6 + 3))


from sys import stdin, stdout
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))
M = 10 ** 6 + 3
p2 = [1]
for i in range(410):
	p2 += [p2[-1] * 2 % M]
for _ in range(1):
	s = input()
	n = len(s)
	ans = c = 0
	dec = {}
	dec['>'] = '1000'
	dec['<'] = '1001'
	dec['+'] = '1010'
	dec['-'] = '1011'
	dec['.'] = '1100'
	dec[','] = '1101'
	dec['['] = '1110'
	dec[']'] = '1111'
	for i in range(n - 1, -1, -1):
		s1 = dec[s[i]]
		for j in range(3, -1, -1):
			if s1[j] == '1':
				ans = (ans + p2[c]) % M
			c += 1
	print(ans)


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)


(s, z, k) = (input(), 0, 0)
for x in s[::-1]:
	if x == '>':
		z += 8 << k
	elif x == '<':
		z += 9 << k
	elif x == '+':
		z += 10 << k
	elif x == '-':
		z += 11 << k
	elif x == '.':
		z += 12 << k
	elif x == ',':
		z += 13 << k
	elif x == '[':
		z += 14 << k
	else:
		z += 15 << k
	k += 4
print(z % 1000003)


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)


s = input()
ans = 0
mod = 1000003
for a in s:
	ans = ans * 16
	if a == '>':
		ans += 8
	elif a == '<':
		ans += 9
	elif a == '+':
		ans += 10
	elif a == '-':
		ans += 11
	elif a == '.':
		ans += 12
	elif a == ',':
		ans += 13
	elif a == '[':
		ans += 14
	elif a == ']':
		ans += 15
	ans = ans % mod
print(ans)


d = {'>': 8, '<': 9, '+': 10, '-': 11, '.': 12, ',': 13, '[': 14, ']': 15}
res = 0
Brainfuck = input()
for i in Brainfuck:
	res = (16 * res + d[i]) % 1000003
print(res)


ch = input()
l = len(ch)
dict = {'>': '1000', '<': '1001', '+': '1010', '-': '1011', '.': '1100', ',': '1101', '[': '1110', ']': '1111'}
i = 0
ans = ''
while i < l:
	ans = ans + dict[ch[i]]
	i = i + 1
final = int(ans, 2)
final = final % 1000003
print(final)


print(int(''.join((bin('><+-.,[]'.index(i) + 8)[2:] for i in input())), 2) % 1000003)


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