N = int(input())
s = input()
S = [str(c) for c in s]

cnt1 = 0; #　.の数
cnt2 = 0;#　#の数

for i in range(N):
    if str(S[i]) == "." and str(S[i-1])=="#":
        cnt1 += 0
    elif str(S[i]) == "#" and str(S[i-1])==".":
        cnt1 += 1
    elif str(S[i]) == "#" and str(S[i-1])=="#":
        cnt1 += 0
    elif str(S[i]) == "." and str(S[i-1])==".":
        cnt1 += 0

print(cnt1)