def sums(n)
  return n*(n+1)/2
end

s = gets.chomp.split("")
cmps = Array.new(0)
mark = Array.new(0)

cnt = 1
pre = s[0]
for i in 1..(s.length-1)
  if s[i] == pre
    cnt += 1
  else
    cmps.push(cnt)
    mark.push(pre)
    cnt = 1
  end
  pre = s[i]
end
cmps.push(cnt)
mark.push(pre)

ans = 0
for i in 0..(cmps.length-1)
  if i == 0
    if cmps.length == 1 || mark[i] == ">"
      ans += sums(cmps[i])
    else
      ans += sums(cmps[i]-1)
    end
  else
    if mark[i] == "<"
      ans += sums(cmps[i])
    elsif mark[i] == ">"
      if cmps[i-1] < cmps[i]
        ans += sums(cmps[i])
      else
        ans += sums(cmps[i]-1)
      end
    end
  end
end
puts ans