summaryrefslogtreecommitdiff
path: root/282A/main.cpp
blob: b40012df7014ab74e7020c0d7c492ffba834ed81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <string>

using namespace std;

int main(){
       string a; 
       getline(cin, a); 
       int b = stoi(a);
       int c = 0;
       for(int i = 0; i < b; i++){
               getline(cin, a, '\n');
               if(a.compare("X++") == 0){
                       c++;
               } else if (a.compare("++X") == 0){
                       ++c;
               } else if (a.compare("--X") == 0){
                       --c; 
               } else {
                       c--;
               }
       }
       cout<<c;
       return 0;
}