In a cage, there are eagles, rabbits and flamingos. There are 50 animals in the cage with a total of 128 legs (assume that flamingos have only one leg). But soon after putting the animals together, the zoo noticed that each eagle ate two of the rabbits each day. After 4 days, there was only one rabbit left in the cage. There are only a total of 32 legs left. How many flamingos are in the cage?