# coding: utf-8
# Your code here!

N = int(input())
S = input()
s_count = 0
d_count = 0
c1 = 0
for i in S:
    if i == "#":
        s_count+=1
    else:
        c1+=s_count
        s_count=0
        d_count+=1
        
print(min(c1,d_count))