Any idea on how can I count the number of elements that verify an "if" condition?
<pre><code>private static int chain(int n){
        int count = 0;
        while(n &gt; 1){
            if(n % 2 == 0){
                count++; //the value is not stored
                return chain(n/2);
            }
            count++; //same thing
            return chain(3*n+1);
        }
        return count; //prints the initial value (0)
    }
}
</code></pre>

<p>I need to print the number of times the chain method reoccurs.</p>
