import math
n = int(input())
s = input()

d = 0
for i in range(n):
    if s[i] != ".":
        d = i
        break

    if i == n-1:
        d = i

count = 0
if s[n-2] == "." and s[n-1] == "#":
    for j in range(n-d-1):
        if s[j+d] == "#":
            count += 1

else:      
    for j in range(n-d):
        if s[j+d] == "#":
            count += 1

print(min((count, n-d-count)))
        

