import java.util.Scanner;
public class stringIfade {
public static String[] convert(String[] text) {
if (text.length == 1) {
return text;
}
String temp;
String[] temp2 = new String[text.length - 2];
String ara = "";
for (String a : text) {
ara += a;
}
System.out.println(ara);
if (ara.indexOf("*") != -1) {
for (int i = 0; i < text.length; i++) {
if (text[i] == "*") {
temp = String.valueOf(Integer.parseInt(text[i - 1]) * Integer.parseInt(text[i + 1]));
temp2[i - 1] = temp;
for (int j = i; j < text.length - 2; j++) {
temp2[j] = text[j + 2];
}
return convert(temp2);
} else {
temp2[i] = text[i];
}
}
} else if (ara.indexOf("/") != -1) {
for (int i = 0; i < text.length; i++) {
if (text[i] == "/") {
temp = String.valueOf(Integer.parseInt(text[i - 1]) / Integer.parseInt(text[i + 1]));
temp2[i - 1] = temp;
for (int j = i; j < text.length - 2; j++) {
temp2[j] = text[j + 2];
}
return convert(temp2);
} else {
temp2[i] = text[i];
}
}
} else if (ara.indexOf("+") != -1) {
for (int i = 0; i < text.length; i++) {
if (text[i] == "+") {
temp = String.valueOf(Integer.parseInt(text[i - 1]) + Integer.parseInt(text[i + 1]));
temp2[i - 1] = temp;
for (int j = i; j < text.length - 2; j++) {
temp2[j] = text[j + 2];
}
return convert(temp2);
} else {
temp2[i] = text[i];
}
}
} else if (ara.indexOf("-") != -1) {
for (int i = 0; i < text.length; i++) {
if (text[i] == "-") {
temp = String.valueOf(Integer.parseInt(text[i - 1]) - Integer.parseInt(text[i + 1]));
temp2[i - 1] = temp;
for (int j = i; j < text.length - 2; j++) {
temp2[j] = text[j + 2];
}
return convert(temp2);
} else {
temp2[i] = text[i];
}
}
}
return null;
}
public static String[] diziyecevir(String ifade) {
int kactanesayi = 0;
char f;
for (int i = 0; i < ifade.length(); i++) {
f = ifade.charAt(i);
if (f == '*' || f == '/' || f == '+' || f == '-') {
kactanesayi++;
}
}
int diziboyutu = kactanesayi + kactanesayi + 1;
String[] sayiDizisi = new String[diziboyutu];
int d = 0;
for (int i = 0; i < sayiDizisi.length; i += 2) {
char a;
String b = "";
for (int j = d; j < ifade.length(); j++) {
a = ifade.charAt(j);
if (a == '*' || a == '/' || a == '+' || a == '-') {
sayiDizisi[i] = b;
sayiDizisi[i + 1] = a + "";
d++;
break;
} else if (j == ifade.length() - 1) {
b += a + "";
sayiDizisi[i] = b;
} else {
b += a + "";
d++;
}
}
}
return sayiDizisi;
}
public static void main(String[] args) {
/*String[] text = {"15", "*", "3", "+", "7", "*", "2", "-", "8", "/", "3"};*/
Scanner scn = new Scanner(System.in);
String sayi = scn.next();
String[] dizi = diziyecevir(sayi);
for (String s: args) {
System.out.println(s);
}
String[] yeni = convert(dizi);
System.out.print("İşleminizin cevabı :");
for (int i = 0; i < yeni.length; i++) {
System.out.print(yeni[i]);
}
}
}