N = int(input())
S = input()
cnt = 0
for i in range(1,N,1):
    if S[i-1] == "#" and S[i] == ".":
        cnt +=1
bcount = S.count("#")
wcount = S.count(".")
if bcount > wcount:
    print(cnt)
else:
    print(min(bcount,wcount))