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