#!/usr/bin/python
# coding: UTF-8

def check(n,s):
    count = 0
    for i in range(1,n):
        if s[i-1] == "#" and s[i] == ".":
            count += 1
    return count

N = int(input())
S = input()

b = S.count("#")
w = S.count(".")
print(check(N,S))