PLC Ladder Diagram same button multiple functions progrmming

this is PLC Ladder Diagram about  the same button needs to achieve a variety of functions, that is, the button 1 times to achieve the first function, according to the second to achieve second functions, according to the third to achieve third functions

The function procedure is triggered by the rising edge of the input signal, so the rising edge of the input signal needs to be acquired. At the same time, it is necessary to count the number of the input signals, and the different values will perform different functions. When the counter reaches a certain value, it is necessary to reset the counter.