import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		char[] c = new char[N];
		String S = sc.next();
		
		
		for(int i=0; i<N; i++) {
			c[i] = S.charAt(i);
		}
		
		int cnt = 0;
		
		for(int i=0; i<N-1; i++) {
			if(c[i] == '#' && c[i+1] == '.') {
				cnt++;
			}
		}
		
		System.out.println(cnt);
	}
}