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