from collections import Counter, deque, defaultdict
N = int(input())
S = input()

c = Counter(S)

fi = 0
for i in S:
    if i == "#":
        fi += 1
    else:
        break

print(max(0, c["#"] - fi))