Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int ka(int n){
  if(n==-1) return 0;
  if(n==0) return 0;
  return n+ka(n-1);
}
int kka(int n){
  return ka(n-1);
}
int main(){
  string s;
  cin>>s;
  s.pb('t');
  ll ans=0;
  int n=s.size();
  int cu<=0;
  int cu>=0;
  rep(i,n){
    if(s[i]=='<'){
      cu<++;
    }
    else{
      cu>++;
    }
    if(s[i]=='>'&&s[i+1]=='<'){
      int h=max(cu<,cu>);
      int g=min(cu<,cu>);
      ans+=kka(g)+ka(h);
      cu<=0;
      cu>=0;
    }
    if(i==n-1){
      int h=max(cu<,cu>);
      int g=min(cu<,cu>);
      ans+=kka(g)+ka(h);
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: expected initializer before '<=' token
   45 |   int cu<=0;
      |         ^~
a.cc:46:9: error: expected initializer before '>=' token
   46 |   int cu>=0;
      |         ^~
a.cc:49:7: error: 'cu' was not declared in this scope; did you mean 'pu'?
   49 |       cu<++;
      |       ^~
      |       pu
a.cc:49:12: error: expected primary-expression before ';' token
   49 |       cu<++;
      |            ^
a.cc:52:7: error: 'cu' was not declared in this scope; did you mean 'pu'?
   52 |       cu>++;
      |       ^~
      |       pu
a.cc:52:12: error: expected primary-expression before ';' token
   52 |       cu>++;
      |            ^
a.cc:55:17: error: 'cu' was not declared in this scope; did you mean 'pu'?
   55 |       int h=max(cu<,cu>);
      |                 ^~
      |                 pu
a.cc:55:20: error: expected primary-expression before ',' token
   55 |       int h=max(cu<,cu>);
      |                    ^
a.cc:55:24: error: expected primary-expression before ')' token
   55 |       int h=max(cu<,cu>);
      |                        ^
a.cc:56:20: error: expected primary-expression before ',' token
   56 |       int g=min(cu<,cu>);
      |                    ^
a.cc:56:24: error: expected primary-expression before ')' token
   56 |       int g=min(cu<,cu>);
      |                        ^
a.cc:62:17: error: 'cu' was not declared in this scope; did you mean 'pu'?
   62 |       int h=max(cu<,cu>);
      |                 ^~
      |                 pu
a.cc:62:20: error: expected primary-expression before ',' token
   62 |       int h=max(cu<,cu>);
      |                    ^
a.cc:62:24: error: expected primary-expression before ')' token
   62 |       int h=max(cu<,cu>);
      |                        ^
a.cc:63:20: error: expected primary-expression before ',' token
   63 |       int g=min(cu<,cu>);
      |                    ^
a.cc:63:24: error: expected primary-expression before ')' token
   63 |       int g=min(cu<,cu>);
      |                        ^