from sys import stdin
n = int(stdin.readline().rstrip())
s = "."+stdin.readline().rstrip()
point = 0
point2 = 0
for i in s:
    if i == ".":
        point += 1
    else:
        break
for j in s[::-1]:
    if j == "#":
        point2 += 1
    else:
        break
s = s[point:len(s)-point2]
S = len(s)
sharp = s.count("#")
flat = S-sharp
print(min(S-sharp,S-flat))