Problem:
Score : 100 points

Problem Statement

We have five variables x_1, x_2, x_3, x_4, and x_5.

The variable x_i was initially assigned a value of i.

Snuke chose one of these variables and assigned it 0.

You are given the values of the five variables after this assignment.

Find out which variable Snuke assigned 0.

Constraints

The values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.

Input

Input is given from Standard Input in the following format:

x_1 x_2 x_3 x_4 x_5

Output

If the variable Snuke assigned 0 was x_i, print the integer i.

Sample Input 1

0 2 3 4 5

Sample Output 1

1

In this case, Snuke assigned 0 to x_1, so we should print 1.

Sample Input 2

1 2 0 4 5

Sample Output 2

3

Solution in C# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;
using System.Globalization;
using System.IO;
using System.Text;

public class Program
{
    public static void Main(string[] args)
    {
        var stdin = Console.OpenStandardInput();
        var ss = new StreamScanner(stdin);
        var p = new Program();
        p.solve(ss);
        stdin.Close();
    }

    private void solve(StreamScanner ss)
    {
        var x = ss.IntArray(5);
        var i = 0;
        while (i < 5)
        {
            if (x[i] == 0) break;
            ++i;
        }
        Console.WriteLine(++i);
    }
}
public class StreamScanner
{
    public StreamScanner(Stream stream) { str = stream; }
    private readonly Stream str;
    private readonly byte[] buf = new byte[1024];
    private int len, ptr;
    public bool isEof = false;
    public bool IsEndOfStream { get { return isEof; } }
    private byte read()
    {
        if (isEof) throw new EndOfStreamException();
        if (ptr >= len)
        {
            ptr = 0;
            if ((len = str.Read(buf, 0, 1024)) <= 0)
            {
                isEof = true;
                return 0;
            }
        }
        return buf[ptr++];
    }
    public char Char
    {
        get
        {
            byte b = 0;
            do b = read();
            while (b < 33 || 126 < b);
            return (char)b;
        }
    }

    public string Scan
    {
        get
        {
            var sb = new StringBuilder();
            for (var b = Char; b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
    }

    public long Long
    {
        get
        {
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
    }

    public int Int => (int)Long;

    public int[] IntArray(int n)
    {
        var arr = new int[n];
        for (var i = 0; i < n; ++i)
        {
            arr[i] = Int;
        }
        return arr;
    }

    public double Double => double.Parse(Scan, CultureInfo.InvariantCulture);
}