I've been trying to create a "counting variable" that determines which observations meet the criteria based on their response to a list of variables.

Criteria:
Of the five variables, v1, v2, v3, v4, v5, eligible observations must have a value of >0 for at least 3 of the five variables. Each variable can have a value of ., 0, 1, 2, 3.

Attempts so far:
I've seen a previous thread counting the number of variables with a certain value, but this is not what I want. I need to determine the eligibility of an observation based on the values of a set of variables. Preferably I want to make a new variable that tells me how many variables that observation has >0 without creating a score of the numerical responses. Something like:

gen crit1 = 0
foreach x in v1 v2 v3 v4 v5 {
replace crit1 = crit1 + 1 if `x' >0
}

But I get a syntax error from this code. Any suggestions would be a huge help.