import copy
N = int(input())
S1 = list(input())
S2 = copy.copy(S1)
count1 = 0
count2 = 0
for i in range(N - 1):
    if S1[i] == "#" and S1[i + 1]==".":
        S1[i + 1] = "#"
        count1 +=1

for i in range(N - 1):
    if S2[i] == "#" and S2[i + 1] == ".":
        S2[i] = "."
        count2 += 1 

print(min(count1,count2))
