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

def check(n,s):
    for i in range(1,n):
        if s[i-1] == "#" and s[i] == ".":
            return False
    return True
N = int(input())
S = input()

b = S.count("#")
w = S.count(".")
if b == 0 or w == 0 or check(N,S):
    print("0")
elif b <= w:
    print(b)
else:
    print(w)