n = int(input())
s = str(input())

s = list(s)

count1 = 0
count2 = 0

for i in range(n):
    if s[i] == '.':
        count1 += 1
    else:
        count2 += 1
        
if s[0] == '.':
    count1 -= 1

if s[n] == '#':
    count2 -= 1
        
print(min(count1,count2))