#include<bits/stdc++.h>
using namespace std;
struct stck{
int a[1000001];
int t;
void clear(){t=0;}
void push(int x){a[++t]=x;}
void pop(){--t;}
int top(){return a[t];}
bool empty(){return !t;}
int size(){return t;}
}s;
int c[10000001];
int main()
{
int m,n,k,x;
scanf("%d%d",&n,&k);
char ch=getchar();
while(ch!='0'&&ch!='1')
{
ch=getchar();
}
while(ch=='0'||ch=='1')
{
s.push(ch-'0');
ch=getchar();
}
while(ch!='+'&&ch!='-'&&ch!='*'&&ch!='/')ch=getchar();
while(ch=='+'||ch=='-'||ch=='*'||ch=='/')
{
if(ch=='+')
{
x=s.top();
s.pop();
s.push(x+1);
}
else if(ch=='-')
{
x=s.top();
s.pop();
s.push(x-1);
}
else if(ch=='*')
{
s.push(0);
}
else if(ch=='/')
{
x=s.top();
s.pop();
x=(x>>1)+s.top();
s.pop();
s.push(x);
}
ch=getchar();
}
m=s.size();
for(int i=1;i<=m;++i)
{
c[i]=s.top();
s.pop();
}
for(int i=1;i<m;++i)
{
c[i+1]+=c[i]>>1;
c[i]-=c[i]>>1<<1;
}
while(c[m]==0&&m>1)--m;
for(int i=m;i>=1;--i)
{
putchar('0'+c[i]);
}
return 0;
}