N = int(input())
S = input()
count1 = 0
count2 = 0
for i in range(N-1):
    if S[i:i+2] == '#.':
        count1 += 1

for i in range(N):
    if S[i] == '.':
        count2 += 1

print(min(count1, count2))