func_code_string: #include <bits/stdc++.h>   using namespace std;   pair<int, int> pts[1001];   int n;   int main() {     cin >> n;     for (int i = 0; i <= n; i++) {       scanf( %d%d , &pts[i].first, &pts[i].second);     }     int ans = 0;     char last =  U ;     for (int i = 1; i < n; i++) {       char cur;       if (pts[i].first == pts[i + 1].first) {         if (pts[i].second > pts[i + 1].second) {           cur =  D ;         } else {           cur =  U ;         }       } else if (pts[i].second == pts[i + 1].second) {         if (pts[i].first > pts[i + 1].first) {           cur =  L ;         } else {           cur =  R ;         }       }       if (last ==  R  && cur ==  U )         ++ans;       else if (last ==  U  && cur ==  L )         ++ans;       else if (last ==  L  && cur ==  D )         ++ans;       else if (last ==  D  && cur ==  R )         ++ans;       last = cur;     }     cout << ans << endl;     return 0;   }   