n = int(input())
s = input()
z = 0
for i in s:
    if i == '#':
        break
    else:
        z += 1
y = 0
for i in range(len(s)-1,-1,-1):
    if s[i] == '.':
        y = i
        break
a = s[z:].count(".")
b = s[z:y].count("#")
print(min(a, b))