#include <bits/stdc++.h>
const long long MOD = 1000000007;
int main() {
  int n;
  std::cin >> n;
  std::string str;
  std::cin >> str;
  std::vector<int> left(n, 0), right(n, 0);
  for (int i = 0; i < n; ++i) {
    if (str[i] == '<') {
      if (i == 0) {
        left[0] = -1;
      } else {
        left[i] = left[i - 1] - 1;
      }
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    if (str[i] == '>') {
      if (i == n - 1) {
        right[n - 1] = 1;
      } else {
        right[i] = right[i + 1] + 1;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (left[i] + i < 0) {
      ++ans;
    }
    if (right[i] + i > n - 1) {
      ++ans;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
