N = int(input())

S = str(input())

cnt = 0
for i in range(1, N):
    if S[i-1] == '#' and S[i] == '.':
        cnt += 1
        continue

cnt_2 = 0
for i in range(N-2, -1, -1):
    if S[i+1] == '.' and S[i] == '#':
        cnt_2 += 1


print(int(min(cnt, cnt_2)))
