if __name__ == '__main__':
    n = int(input())
    s = input()
    s_list = list(s)
    ans = 0
    for i in range(len(s_list) - 1):
        if s_list[i] == '#' and s_list[i + 1] == '.':
            if i == 0 or s_list[i - 1] != '#':
                s_list[i] = '.'
            else:
                s_list[i + 1] = '#'
            ans += 1
    print(ans)
