N = int(input())
S = input()
count = 0
split_list = []
part = ""
for s in S:
    if not part:
        part += s
    elif s in part:
        part += s
    else:
        split_list.append(part)
        part = s
split_list.append(part)

count = 0

# print(split_list)
for idx, part in enumerate(split_list):
    if '#' in part and idx+1 < len(split_list):
        count += min(len(part), len(split_list[idx+1]))
print(count)