import java.util.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class Main {
public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
Scanner cin = new Scanner(System.in);
int flag = 0;
while (cin.hasNext()) {
int f = 0;
String str = cin.next();
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
if (ch == '+') {
f = 1;
}
if (ch == '-') {
f = 2;
}
}
String str1[] = str.split("\\+|\\-|\\=|\\?");// 用字符串数组存起来
//System.out.println(str1.length);
int count = str1.length;
if (count == 3) {
int a = Integer.parseInt(str1[0]);// parseInt后面加String类型
int b = Integer.parseInt(str1[1]);
int c = Integer.parseInt(str1[2]);
if (f == 1) {
if (a + b == c) {
flag++;
//System.out.println(flag);
}
}
if (f == 2) {
if (a - b == c) {
flag++;
}
}
}
}
System.out.println(flag);
}
}