#include <iostream>
#include <cstdio>
using namespace std;
int main() {
char s[100];
int a, b, c, ans=0;
while (cin.getline(s, 100)){
if (sscanf(s, "%d+%d=%d", &a, &b, &c)==3 && a+b==c){
ans++;
}
else if (sscanf(s, "%d-%d=%d", &a, &b, &c)==3 && a-b==c){
ans++;
}
}
cout << ans <<endl;
}