Language: C++

using ll=long long;
#define int ll
 
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif
 
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
 
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
 
using pi=pair<int,int>;
using vi=vc<int>;
 
template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}
 
template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}
 
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
	string s;cin>>s;
	int n=s.size()+1;
	vi a(n);
	rep(i,n-1)
		if(s[i]=='<')
			chmax(a[i+1],a[i]+1);
	per(i,n-1)
		if(s[i]=='>')
			chmax(a[i],a[i+1]+1);
	cout<<accumulate(all(a),int(0))<<endl;
}

Compiler output:
a.cc:24:28: error: 'vector' does not name a type
   24 | template<class t> using vc=vector<t>;
      |                            ^~~~~~
a.cc:25:29: error: 'vc' does not name a type
   25 | template<class t> using vvc=vc<vc<t>>;
      |                             ^~
a.cc:27:10: error: 'pair' does not name a type
   27 | using pi=pair<int,int>;
      |          ^~~~
a.cc:28:10: error: 'vc' does not name a type
   28 | using vi=vc<int>;
      |          ^~
a.cc:31:1: error: 'ostream' does not name a type
   31 | ostream& operator<<(ostream& os,const pair<t,u>& p){
      | ^~~~~~~
a.cc:35:19: error: 'ostream' does not name a type
   35 | template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
      |                   ^~~~~~~
a.cc: In function 'int main()':
a.cc:42:9: error: 'cin' was not declared in this scope
   42 |         cin.tie(0);
      |         ^~~
a.cc:43:9: error: 'ios' has not been declared
   43 |         ios::sync_with_stdio(0);
      |         ^~~
a.cc:44:9: error: 'cout' was not declared in this scope
   44 |         cout<<fixed<<setprecision(20);
      |         ^~~~
a.cc:44:15: error: 'fixed' was not declared in this scope
   44 |         cout<<fixed<<setprecision(20);
      |               ^~~~~
a.cc:44:22: error: 'setprecision' was not declared in this scope
   44 |         cout<<fixed<<setprecision(20);
      |                      ^~~~~~~~~~~~
a.cc:46:9: error: 'string' was not declared in this scope
   46 |         string s;cin>>s;
      |         ^~~~~~
a.cc:46:23: error: 's' was not declared in this scope
   46 |         string s;cin>>s;
      |                       ^
a.cc:48:9: error: 'vi' was not declared in this scope
   48 |         vi a(n);
      |         ^~
a.cc:10:11: error: 'first' was not declared in this scope
   10 | #define a first
      |           ^~~~~
a.cc:51:31: note: in expansion of macro 'a'
   51 |                         chmax(a[i+1],a[i]+1);
      |                               ^
a.cc:10:11: error: 'first' was not declared in this scope
   10 | #define a first
      |           ^~~~~
a.cc:54:31: note: in expansion of macro 'a'
   54 |                         chmax(a[i],a[i+1]+1);
      |                               ^
a.cc:10:11: error: 'first' was not declared in this scope
   10 | #define a first
      |           ^~~~~
a.cc:14:16: note: in definition of macro 'all'
   14 | #define all(x) x.bg,x.ed
      |                ^
a.cc:55:30: note: in expansion of macro 'a'
   55 |         cout<<accumulate(all(a),int(0))<<endl;
      |                              ^
a.cc:55:15: error: 'accumulate' was not declared in this scope
   55 |         cout<<accumulate(all(a),int(0))<<endl;
      |               ^~~~~~~~~~
a.cc:55:42: error: 'endl' was not declared in this scope; did you mean 'ed'?
   55 |         cout<<accumulate(all(a),int(0))<<endl;
      |                                          ^~~~
      |                                          ed