using System;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Collections;
using System.Threading;
using System.Resources;
using System.Collections.Generic;

namespace DaniloStojanovic
{
    class Program
    {
        
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            int[,] mat = new int[n, m];
            for(int i = 0; i < n; i++)
            {
                s = Console.ReadLine().Split(' ');
                for(int j = 0; j < m; j++)
                {
                    mat[i,j] = int.Parse(s[j]);
                }
            }
            Random r = new Random();
            Console.WriteLine(r.Next(0, 2));
        }
    }
}