N = int(input())
S = input()
list_S = list(S)
N1 = 0
X = list_S.count('.')
for N in list_S:
    if list_S[N1] == '.':
            N1 +=1
    else:
        list_S1 = list_S[N1:]
        X1 = list_S1.count('#')
        X2 = list_S1.count('.')
        break

if X1 > X2:
    print(X2)
else:
    print(X1)