import sys
N = raw_input()
S = raw_input()
 
flag = 0
cnt = 0
cnt2 = 0
T =  S.rstrip("#")
for s in T:
    if s == '#':
        flag = 1
        cnt2 +=1
    elif s == '.' and flag ==1:
        cnt += 1

print(min(cnt, cnt2))