N = int(input())
S = str(input())
cnt = 0
S_list = list(S)
for i in range(0,N-1):
    if S_list[i] != S_list[i+1]:
        if S_list[i] == "#":
            cnt += 1
            S_list[i+1] = "#"
        elif S_list[i] == ".":
            cnt += 1
            S_list[i+1] = "."
print(cnt)