N = int(input())
S = input()
s_list = list(S)
count = 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
            flag += 1
    if flag == 0:
        break
print(count)