import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int left = 0; int right = 0; char[] arr = sc.next().toCharArray(); for (int i = 0; i < arr.length; i++) { if (arr[i] == '*') { if (arr[i - 1] == '^') { left++; } else { right++; } } } System.out.println(left + " " + right); } }