Valeo Interview Question

Write a code to count how many rise edges.