N = int(input())
S = input()
s_list = list(S)
count_1 = 0
count_2 = 0
while True:
    flag = 0
    for i in range(N-1):
        if s_list[i] == "#" and s_list[i+1] == ".":
            s_list[i+1] = "#"
            count_1 += 1
            flag += 1
    if flag == 0:
        break

while True:
    flag = 0
    for i in range(N-1):
        if s_list[i] == "#" and s_list[i+1] == ".":
            s_list[i] = "."
            count_2 += 1
            flag += 1
    if flag == 0:
        break
if count_1 > 0 and count_2 > 0:
    print(min(count_1,count_2))
else:
    print(count_1)