N = int(input())
S = input()

# def transB(N,S):
#     ret = 0
#     for i in S:
#         if i == "#":
#             ret += 1
#     return ret
    
# def transW(N,S):
#     ret = 0

num_W = 0  
for i in S:
    if i == ".":
        num_W += 1
num_B = N - num_W

if num_W < num_B:
    print(num_W)
else:
    if S[N-1] == "#":
        print(num_B - 1)
    else:
        print(num_B)