N = int(input())
S = str(input())
S_list = list(S)
i = 0
count = 0
for i in range(N-1):
    if S_list.count("#") >= S_list.count("."):
        if(S_list[i] == "#" and S_list[i+1] == "."):
            S_list[i+1] = "#"
            count += 1
            i += 1
        else:
            i += 1
    else:
        if(S_list[i] == "#" and S_list[i+1] == "."):
            S_list[i+1] = "."
            count += 1
            i += 1
        else:
            i += 1
print(count)