import sys

N = int(sys.stdin.readline())
S = input()

#S = list(S)
S_1 = S
S_2 = S
S_1 = list(S_1)
S_2 = list(S_2)

cnt_cb = 0
cnt_cw = 0
for i in range(len(S_1)-1):
#    print(S_1[i],S_1[i+1])
    if S_1[i]=="#" and S_1[i+1]==".":
        S_1[i+1] = "#"
        cnt_cb += 1
#        print("change")


for i in range(len(S_2)-1):
#    print(S_2[i],S_2[i+1])
    if S_2[i]=="#" and S_2[i+1]==".":
        S_2[i] = "."
        cnt_cw += 1
#        print("change")

print(min(cnt_cb,cnt_cw))