import std.conv, std.stdio, std.algorithm, std.string, std.range;

void main() {
  auto S   = readln.chomp.to!string;
  auto arr = new int[S.length+1];
  
  int y;
  foreach (i, c; S) {
    const x = arr[i] + (c == '>'? -1: 1);
    arr[i+1] = x;
    y = y.min(x);
  }
  arr.each!((ref x) => x -= y);
  
  S   ~= "<>";
  arr ~= [int.max, 0];
  
  size_t down_begin   = 0;
  int    valley_value = arr[0];
  foreach (i; 1..S.length) {
    if (S[i-1] == '>' && S[i] == '<') {
      valley_value = arr[i];
    }
    if (S[i-1] == '<' && S[i] == '>') {
      foreach (ref x; arr[down_begin..i+1]) {
        x -= valley_value;
      }
      if (down_begin > 0) {
        if (arr[down_begin] <= arr[down_begin-1]) arr[down_begin] = arr[down_begin-1]+1;
        if (arr[down_begin] <= arr[down_begin+1]) arr[down_begin] = arr[down_begin+1]+1;
      }
      down_begin = i.to!int;
    }
  }
  arr[0..$-2].sum.writeln;
}