using System;
public class Program
{
public static void Main()
int[] arrayToTest = {5,3,0,5,6,7,8,1,2,3,4,5,6,32,123,54,6,1};
// 1 + 1 + 0 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 2 + 1 + 2 + 2 + 1 + 2 + 2 + 1 = 26
Console.WriteLine(ReturnAnswer(arrayToTest));
//Should print 26
}
public static int ReturnAnswer(int[] arr){
int answer = 0;
for (int i = 0; i < arr.Length; i++){
if( arr[i] % 2 == 0) {
if (arr[i] == 8){
answer += 3;
}else if (arr[i] != 0){
answer += 2;
}else if(arr[i] == 0){
break;
}else{
answer += 1;
return answer;