n = int(input())
s = input()

black_index = [j for j in range(len(s)) if s[j] =="#"]
white_index = [j for j in range(len(s)) if s[j] =="."]

if len(black_index) == 0 or len(white_index) ==0:
    print(0)
else:
    black_new_index = [black_index[j] for j in range(len(black_index)) if black_index[j]+1 not in black_index]
    white_new_index = [white_index[j] for j in range(len(white_index)) if white_index[j]+1 not in white_index]
    print(min(max(len(black_new_index),1), max(len(white_new_index),1)))