#include<bits/stdc++.h>
using namespace std;

int main(){
    int N;    
    string S;
    cin >> N;
    cin >> S;
    int left = -1;
    int count = 0;
    int count2 = 0;
    bool flag=false;
    for(int i=0; i<N; i++){
	if(S[i] == '#' && left == -1){
	    left = i;
	}
	if(left != -1 && S[i] == '.'){
	    flag = true;
	}
	    
	    
    }
    for(int i=left; i<N; i++){
	if(S[i] == '.'){
	    count++;
	}	    
    }
    
    for(int i=0; i<N; i++){
	if(S[i] == '#'){
	    count2++;
	}	    
    }
    cout << count << endl;
    
    cout << count2 << endl;
    count = min(count, count2);
    
 
    if(left == -1 || !flag){
	cout << 0 << endl;
    }
    else{
	
	cout << count << endl;
    }
    