#include <bits/stdc++.h>
using namespace std;
const long long N = 1e4 + 0.000001;
int main() {
  cout.tie(NULL);
  cin.tie(NULL);
  ios_base::sync_with_stdio(0);
  long long n;
  string g, s;
  cin >> n >> g;
  deque<long long> v;
  long long cnt = 0;
  for (long long i = 0; i < g.size() - 1; i++) {
    if (g[i] == g[i + 1])
      cnt++;
    else
      v.push_back(cnt + 1), cnt = 0, s += g[i];
  }
  v.push_back(cnt + 1);
  if (v.size() > s.size() + 1) v.erase(v.begin() + v.size());
  long long qwe = 0;
  s += g[g.size() - 1];
  for (long long i = 0; i < s.size(); i++) {
    long long ans = i;
    map<long long, long long> mp;
    while (ans >= 0 and ans < s.size() and mp[ans] == 0) {
      mp[ans]++;
      if (s[ans] == '>')
        ans++;
      else if (s[ans] == '<')
        ans--;
    }
    if (ans < 0 or ans >= s.size()) qwe += v[i];
  }
  cout << qwe;
}
