import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  auto s = readln.chomp;

  auto l_res = new int[](s.length + 1);
  auto r_res = new int[](s.length + 1);
  foreach (i; 0..s.length) {
    if (s[i] == '<') {
      l_res[i+1] = l_res[i] + 1;
    }
    if (s[$-1-i] == '>') {
      r_res[$-1-i-1] = r_res[$-1-i] + 1;
    }
  }

  int res;
  foreach (i; 0..l_res.length) {
    res += max(l_res[i], r_res[i]);
  }
  
  res.writeln;
}
