#define _USE_MATH_DEFINES

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max,count
#include <string>	//string,getline
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap
#include <cstdlib>	//abs(int)
#include <cmath>	//sqrt
#include <sstream>	//stringstream,getline
#include <cmath>	//ceil,M_PI
#include <numeric>	//gcd

using namespace std;

int main() {

	string S;
	cin >> S;

	int a = 0;
	int b = 0;

	if (S[0] == '#') {
	}
	else {
		for (unsigned int i = 0; i < S.length(); i++) {
			if (S[i] == '*') {
				if (S[i - 1] == '^') {
					a++;
				}
				else {
					b++;
				}
			}
		}
	}
	cout << a << " " << b << endl;

	return 0;

}