import java.util.ArrayDeque; import java.util.Deque; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); sc.close(); Deque que = new ArrayDeque<>(); for (int i = 0; i < s.length; i++) { if (s[i] == '>') { int cnt = 0; while (!que.isEmpty()) { char c = que.pop(); if (c == '=') { cnt++; } else { que.push(c); break; } } if (que.isEmpty() || cnt == 0) { for (int j = 0; j < cnt; j++) { que.push('='); } que.push('>'); } else { char c = que.pop(); if (c != '<') { que.push(c); for (int j = 0; j < cnt; j++) { que.push('='); } que.push('>'); } } } else { que.push(s[i]); } } System.out.println(que.size()); } }