Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For example, a calendar for January 2017 should look like on the picture:  Petr wants to know how many columns his table should have given the month and the weekday of the first date of that month? Assume that the year is non-leap.

The only line contain two integers m and d (1 ≤ m ≤ 12, 1 ≤ d ≤ 7) — the number of month (January is the first month, December is the twelfth) and the weekday of the first date of this month (1 is Monday, 7 is Sunday).

Print single integer: the number of columns the table should have.

NoteThe first example corresponds to the January 2017 shown on the picture in the statements.In the second example 1-st January is Monday, so the whole month fits into 5 columns.In the third example 1-st November is Saturday and 5 columns is enough.

using System;
using System.IO;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] month30 = { 4, 6, 9, 11 };
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int days;
            if (a[0] == 2)
            {
                days = 28;
            }
            else if (month30.Contains(a[0]))
            {
                days = 30;
            }
            else
            {
                days = 31;
            }
            days -= 8 - a[1];
            int c = days / 7;
            int rez = days - c * 7 > 0 ? 1 : 0;
            Console.WriteLine((c + 1 + rez));
        }
    }
}

using System;

class A
{
  public static void Main()
  {
    int[] mouth = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int total = 1;

    string line = Console.ReadLine();

    int m = int.Parse(line.Split(' ')[0]),
        d = int.Parse(line.Split(' ')[1]);

    d =  mouth[m] - (8-d);

    //Console.WriteLine("{0} {1}", d, (decimal)d/7);
    total += (int)Math.Ceiling((decimal)d / 7);

    Console.WriteLine(total);
  }
}

using System;

namespace CSharp
{
    class _760
    {
        public static void Main()
        {
            int[] monthLength = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            var tokens = Console.ReadLine().Split();

            int m = int.Parse(tokens[0]) - 1;
            int d = int.Parse(tokens[1]) - 1;

            Console.WriteLine((monthLength[m] + d) / 7 + Math.Sign((monthLength[m] + d) % 7));
        }
    }
}

using System;

public class Program
{
    public static void Main(string[] args)
    {
        int[] months = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        if (months.Length != 12) {
            Console.WriteLine("Months not correct");
            return;
        }
        string[] input = Console.ReadLine().Split(' ');
        int m = int.Parse(input[0]);
        int d = int.Parse(input[1]);
        int[, ] c = new int[7, 10];
        int x = d - 2;
        for (int i = 1; i <= months[m - 1]; i++)
        {
            x++;
            c[x % 7, x / 7] = i;
        }
        Console.WriteLine(x / 7 + 1);
    }
}

using System;

using static System.Console;
class Solution
{
    static void Main(string[] args)
    {
        int[] a = Array.ConvertAll(ReadLine().Split(), int.Parse);
        int days = DateTime.DaysInMonth(2021, a[0]);
        int weeks = days > 28 ? 5 : 4;
        if (a[1] > 1 && a[0] == 2) weeks++;
        else if (a[1] > 5 && days > 30) weeks++;
        else if (a[1] > 6) weeks++;
        WriteLine(weeks);
    }

}

using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A {
	class Program {
		static void Main() {
			int[] arr = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int m = arr[0];
			int d = arr[1];
			int[] m31 = {1,3,5,7,8,10,12};
			int[] m30 = {4,6,9,11};
			int spaces = d - 1;
			int ret = 0;

			if (m31.Contains(m)) {
				spaces += 31;
			}
			else if (m30.Contains(m)) {
				spaces += 30;
			}
			else {
				spaces += 28;
			}

			if (spaces % 7 == 0) ret = spaces / 7;
			else ret = spaces / 7 + 1;

			Console.WriteLine(ret);
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Problem760A
{
    class Program
    {
        static void Main(string[] args)
        {
            int m = NextInt(), d = NextInt();
            Dictionary<int, int> months = new Dictionary<int, int>();
            months[1] = 31;
            months[2] = 28;
            months[3] = 31;
            months[4] = 30;
            months[5] = 31;
            months[6] = 30;
            months[7] = 31;
            months[8] = 31;
            months[9] = 30;
            months[10] = 31;
            months[11] = 30;
            months[12] = 31;
            double x = Math.Ceiling(((double)months[m] + d - 1) / 7);
            Console.Write(x);
            //Console.ReadLine();
        }
        static int s_index = 0;
        static List<string> s_tokens;
        private static string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }
        private static int NextInt()
        {
            return Int32.Parse(Next());
        }
    }
}

using System;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var m = cin.NextInt();
			var d = cin.NextInt();
			var days = DateTime.DaysInMonth(2017, m);
			var first = 7 - d + 1;
			var left = days - first;
			var count = left/7;
			if (left%7 > 0)
			{
				count++;
			}
			Console.WriteLine(count + 1);
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace Olymp
{
  public class ProblemSolver
  {
    private Tokenizer input;

    public void Solve()
    {
      int m = input.NextInt();
      int d = input.NextInt();
      int c = new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }[m - 1];
      Console.Write((c + d - 2) / 7 + 1);
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private TextReader reader;

    public int NextInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      bool isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = this.reader.Read();
        if (c == -1)
          throw new InvalidOperationException();
      }
      if (!char.IsDigit((char)c))
        throw new InvalidOperationException();
      int result = (char)c - '0';
      c = this.reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException();
        result = result * 10 + (char)c - '0';
        c = this.reader.Read();
      }
      if (isNegative)
        result = -result;
      return result;
    }

    public string ReadLine()
    {
      return reader.ReadLine();
    }

    public long NextLong()
    {
      return long.Parse(this.NextToken());
    }

    public double NextDouble()
    {
      return double.Parse(this.NextToken(), CultureInfo.InvariantCulture);
    }

    public int[] ReadIntArray(int n)
    {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = NextInt();
      return a;
    }

    public long[] ReadLongArray(int n)
    {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = NextLong();
      return a;
    }

    public double[] ReadDoubleArray(int n)
    {
      double[] a = new double[n];
      for (int i = 0; i < n; i++)
        a[i] = NextDouble();
      return a;
    }

    public string NextToken()
    {
      var c = SkipWS();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = this.reader.Read();
      }
      return sb.ToString();
    }

    private int SkipWS()
    {
      int c = this.reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = this.reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  class Program
  {
    public static void Main(string[] args)
    {
      var solver = new ProblemSolver(Console.In);
      solver.Solve();
    }
  }

  #endregion
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Task2
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            var m = arr[0];
            var d = arr[1];

            int days;

            if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
                days = 31;
            else
                days = 30;

            if (m == 2)
                days = 28;

            var cols = days - (8 - d);
            int res = 0;

            if (cols % 7 == 0)
            {
                res = cols / 7 + 1;
            }
            else
            {
                res = cols / 7 + 2;
            }

            Console.Write(res);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static int Number(int dataWeek, int dataMonth)
        {
            int res = 0;
            if ((dataMonth % 2 != 0 && dataMonth <= 7) || (dataMonth % 2 == 0 && dataMonth >= 8))
            {
                if(dataWeek <= 5)
                {
                    res = 5;
                }
                else
                {
                    res = 6;
                }
            }
            else if(dataMonth == 2)
            {
                if(dataWeek == 1)
                {
                    res = 4;
                }
                else
                {
                    res = 5;
                }
            }
            else
            {
                if(dataWeek <= 6)
                {
                    res = 5;
                }
                else
                {
                    res = 6;
                }
            }
            return res;
        }
        private static void Main(string[] args)
        {
            int[] data = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int dataMonth = data[0];
            int dataWeek = data[1];

            int result = Number(dataWeek, dataMonth);
            Console.WriteLine(result);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace codeforces_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] num = Console.ReadLine().Split(' ');
            int m = int.Parse(num[0]);
            int d = int.Parse(num[1]);
            if (m==4 || m==6 || m==9 || m==11)
            {
                if(d == 7)
                {
                    Console.WriteLine("6");
                }
                else
                    Console.WriteLine("5");
            }
            else if(m==2)
            {
                if(d==1) Console.WriteLine("4");
                else
                    Console.WriteLine("5");
            }
            else
            {
                if (d==6 || d==7)
                {
                    Console.WriteLine("6");
                }
                else
                    Console.WriteLine("5");
            }
            return;
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        int m, d;

        public void Solve()
        {
            m = ioHelper.ReadNextInt();
            d = ioHelper.ReadNextInt();

            int noDays = 30;

            if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
                noDays = 31;

            if (m == 2)
                noDays = 28;

            int result = 1;

            for (int curDay = d; curDay <= 7; curDay++)
                noDays--;

            result += noDays / 7;

            if ((noDays % 7) > 0)
                result++;

            ioHelper.WriteLine(result.ToString());
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}

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

namespace Petr_and_a_calendar
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int m = Next();
            int d = Next();

            int days = DateTime.DaysInMonth(2017, m);
            days -= 8 - d;
            int count = 1 + (days+6)/7;

            writer.WriteLine(count);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;

namespace _760A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] months = new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            string[] input = Console.ReadLine().Split(' ');
            int m = int.Parse(input[0]) - 1, d = int.Parse(input[1]);
            int result = 1;
            for (int i = 1, j = d; i <= months[m]; i++, j++)
                if (j > 7)
                {
                    result++;
                    j = 1;
                }
            Console.WriteLine(result);
        }
    }
}

using System;

namespace CodeForces17
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] data = Array.ConvertAll(Console.ReadLine().Split(' '), x => int.Parse(x));
			int m = data[0];
			int d = data[1];
			int days = 0;
			switch (m)
			{
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:
					days = 31 + d - 1;
					break;
				case 2: days = 28 + d - 1;
					break;
				case 4:
				case 6:
				case 9:
				case 11:
					days = 30 + d - 1;
					break;
			}
			Console.WriteLine(days / 7 + (days % 7 > 0 ? 1 : 0));
		}
	}
}

using System;

namespace Number760A {
    class Program {
        static void Main(string[] args) {
            var mas = Console.ReadLine().Split(' ');
            Int32 numberMonth = Int32.Parse(mas[0]);
            Int32 numberWeekDays = Int32.Parse(mas[1]);
            Int32 days = GetCountDays(numberMonth) - 8 + numberWeekDays;
            Int32 mod = days % 7 == 0 ? 0 : 1;
            Console.WriteLine((Int32)(days / 7.0) + mod + 1);
        }

        static Int32 GetCountDays(Int32 m) {
            if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
                return 31;
            if(m == 4 || m == 6 || m == 9 || m == 11)
                return 30;
            return 28;
        }
    }
}

using System;
using System.Globalization;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Codeforces
{
    class Program : ProgramBase
    {
        private const long commonMod = 1000000007;

        static void Main(string[] args)
        {
            var p = new Program();
            var x = p.Solve();
            p.Out(x);
        }

        object Solve()
        {
            var m = ReadLong();
            var d = ReadLong();
            if (m == 2)
                return d == 1 ? 4 : 5;

            var ms = new long[] { 1, 3, 5, 7, 8, 10, 12 };
            if (ms.Contains(m))
                return d == 6 || d == 7 ? 6 : 5;
            return d == 7 ? 6 : 5;

        }
        //object Solve()
        //{
        //    checked
        //    {
        //        var n = ReadLong();
        //        var s = Read().Select(x => long.Parse(x.ToString())).ToArray();
        //        var dp = new Tuple<int, long>[60];
        //        dp[0] = Tuple.Create(0, s[0]);
        //        for (int i = 1; i < s.Length; i++)
        //        {
        //            if (s[i] == 1 && s[i - 1] < 6)
        //            {
        //                var r = i == 1 ? -1 : dp[i - 2].Item1;
        //                var prevRes = i == 1 ? 0 : dp[i - 2].Item2;
        //                dp[i] = Tuple.Create(r + 1, FastPow(16, r + 1) * (10 + s[i - 1]) + prevRes);
        //            }
        //            else
        //            {
        //                var r = dp[i - 1].Item1;
        //                var prevRes = dp[i - 1].Item2;
        //                dp[i] = Tuple.Create(r + 1, FastPow(16, r + 1) * s[i] + prevRes);
        //            }
        //        }
        //        return dp[s.Length - 1].Item2;
        //    }
        //}
        //Tuple<int, long> Check(long bas, int[] s, int i)
        //{
        //    var strB = bas.ToString().Select(x => int.Parse(x.ToString())).ToArray();
        //    if (i < strB.Length - 1)
        //        return Tuple.Create(-1, 0L);
        //    for (int j = 0; j < strB.Length; j++)
        //    {
        //        if (strB[j] < s[i - j])
        //        {
        //            for (int i = 0; i < strB.Le; i++)
        //            {

        //            }

        //                }
        //    }
        //}

        long FastPow(long b, long pow)
        {
            if (pow == 0)
                return 1;
            if (pow == 1)
                return b;
            if (pow % 2 == 0)
                return FastPow(b * b, pow / 2);
            return b * FastPow(b, pow - 1);
        }

        bool IsPrime(int n)
        {
            for (int i = 2; i <= Math.Sqrt(n); i++)
            {
                if (n % i == 0)
                    return false;
            }
            return true;
        }
    }

    class DSU
    {
        private int[] arr;
        private Random r = new Random();
        public DSU(int n)
        {
            arr = new int[n];
            for (int i = 0; i < n; i++)
            {
                arr[i] = i;
            }
        }

        public int Find(int x)
        {
            if (arr[arr[x]] == arr[x])
                return arr[x];
            var y = Find(arr[x]);
            arr[x] = y;
            return y;
        }

        public void Union(int x, int y)
        {
            var p1 = Find(x);
            var p2 = Find(y);
            if (p1 == p2)
                return;
            if (r.NextDouble() < 0.5)
                arr[p1] = p2;
            else
                arr[p2] = p1;
        }

        public int[][] Enumerate()
        {
            return arr.Select((x, i) => new { g = Find(x), i }).GroupBy(x => x.g, (k, e) => e.Select(y => y.i).ToArray()).ToArray();
        }
    }

    abstract class ProgramBase
    {
        bool? prod = null;
        StreamReader f;
        Queue<string> tokens;
        protected string FileName { private get; set; }

        protected string Read()
        {
            if (f == null)
                f = string.IsNullOrEmpty(FileName)
                    ? new StreamReader(Console.OpenStandardInput())
                    : new StreamReader((GetProd() ? "" : "c:\\dev\\") + FileName);
            return f.ReadLine();
        }

        protected string ReadToken()
        {
            if (tokens == null || tokens.Count == 0)
                tokens = new Queue<string>(Read().Split(' '));
            return tokens.Dequeue();
        }

        protected long ReadLong() { return long.Parse(ReadToken()); }

        protected long[] ReadLongs()
        {
            var s = Read();
            if (s == "")
                return new long[0];
            var tokens = s.Split(' ');
            var result = new long[tokens.Length];
            for (int i = 0; i < tokens.Length; i++)
                result[i] = long.Parse(tokens[i]);
            return result;
        }

        public void Out(object r)
        {
            if (string.IsNullOrEmpty(FileName))
                Console.WriteLine(r);
            else if (GetProd())
                File.WriteAllText(FileName, r.ToString());
            else
                Console.WriteLine(r);
        }

        private bool GetProd()
        {

            if (!prod.HasValue)
                try
                {
                    prod = Environment.MachineName != "RENADEEN-W7";
                }
                catch (Exception)
                {
                    prod = true;
                }
            return prod.Value;
        }
    }

    public static class Huj
    {
        public static T MinBy<T>(this IEnumerable<T> source, Func<T, double> func) where T : class
        {
            T result = null;
            var min = double.MaxValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (min > current)
                {
                    min = current;
                    result = item;
                }
            }
            return result;
        }

        public static T MaxBy<T>(this IEnumerable<T> source, Func<T, double> func, T defaultValue = default(T))
        {
            T result = defaultValue;
            var max = double.MinValue;
            foreach (var item in source)
            {
                var current = func(item);
                if (max < current)
                {
                    max = current;
                    result = item;
                }
            }
            return result;
        }

        public static string JoinStrings(this IEnumerable<string> s, string d) { return string.Join(d, s.ToArray()); }

        public static string JoinStrings(this IEnumerable<int> s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }
        public static string JoinStrings(this IEnumerable<long> s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

namespace CF317
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
			//using (var sw = new StreamWriter("output.txt"))
			{
				task.Solve(sr, sw);

				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var m = input[0];
			var d = input[1];
			var daysInMonth = new int[] { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
			var totalDays = daysInMonth[m];
			var cols = 1;
			var dayOfWeek = d;
			while (totalDays > 0) {
				if (dayOfWeek > 7) {
					dayOfWeek = 1;
					cols++;
				}
				dayOfWeek++;
				totalDays--;
			}

			sw.WriteLine(cols);
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
				.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
				.Select(s => func(s, CultureInfo.InvariantCulture))
				.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
				str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
						.Select(s => func(s, CultureInfo.InvariantCulture))
						.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose)
		{
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chloe_and_the_Sequence
{
    class Program
    {
        static void Main(string[] args)
        {
            int m, d;
            string[] input = Console.ReadLine().Split(' ');
            m = int.Parse(input[0]);
            switch(m)
            {
                case 1:
                    m = 31;
                    break;
                case 2:
                    m = 28;
                    break;
                case 3:
                    m = 31;
                    break;
                case 4:
                    m = 30;
                    break;
                case 5:
                    m = 31;
                    break;
                case 6:
                    m = 30;
                    break;
                case 7:
                    m = 31;
                    break;
                case 8:
                    m = 31;
                    break;
                case 9:
                    m = 30;
                    break;
                case 10:
                    m = 31;
                    break;
                case 11:
                    m = 30;
                    break;
                case 12:
                    m = 31;
                    break;
            }
            d = int.Parse(input[1]);
            if ((m + (d - 1)) % 7 == 0)
                Console.WriteLine((m + (d - 1)) / 7);
            else
                Console.WriteLine((m + (d - 1)) / 7 + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class cf001
{
    static void Main()
    {
        string input = Console.ReadLine();
        int month = int.Parse(input.Split()[0]);
        int weekday = int.Parse(input.Split()[1]);
        int result;
        List<int> months = new List<int>() { 1, 3, 5, 7, 8, 10, 12 };

        if (month == 2 && weekday == 1)
        {
            result = 4;
        }
        else if (month == 2)
        {
            result = 5;
        }
        else if ((months.Contains(month)&& weekday > 5) ||(weekday>6))
        {
            result = 6;
        }else
        {
            result = 5;
        }

        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Task1
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();

            var month = input[0];
            var firstDayInMoth = input[1];

            var daysInMonth = DateTime.DaysInMonth(2001, month);
            var daysInFirstWeek = 7 - firstDayInMoth + 1;

            var weeks = (daysInMonth - daysInFirstWeek) / 7;

            var rest = daysInMonth - weeks * 7;

            if (rest == daysInFirstWeek) weeks += 1;
            else weeks += 2;

            Console.WriteLine(weeks);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] menesiuIlgumai = new int[13] {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            string[] duomenys = Console.ReadLine().Split(' ');
            int m = int.Parse(duomenys[0]);
            int d = int.Parse(duomenys[1]);
            int columns = 1;
            int menesioIlgumas = menesiuIlgumai[m];
            menesioIlgumas -= (8 - d);
            columns += menesioIlgumas % 7 == 0 ? menesioIlgumas / 7 : (menesioIlgumas / 7) + 1;
            Console.WriteLine(columns);
        }
    }
}

using System;

namespace tmp6
{
    class Program
    {
        static void Main()
        {
            int m = 0, columns = 0;
            string[] s = Console.ReadLine().Split(' ');
            m = int.Parse(s[0]);
            columns += int.Parse(s[1]) - 1;
            columns += System.DateTime.DaysInMonth(2017, m);
            if(columns % 7 == 0)
                columns /= 7;
            else
            {
                columns /= 7;
                columns++;
            }
            Console.WriteLine(columns);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A.Petr_and_a_calendar
{
    class Program
    {
        static void Main(string[] args)
        {
            int January = 31;
            int February = 28;
            int March = 31;
            int April = 30;
            int May = 31;
            int June = 30;
            int July = 31;
            int August = 31;
            int September = 30;
            int October = 31;
            int November = 30;
            int December = 31;

            string[] text = Console.ReadLine().Split(' ');
            int m = int.Parse(text[0]);
            int d = int.Parse(text[1]);
            int month=0;
            switch (m)
            {
                case 1:
                    month = January;
                    break;
                case 2:
                    month = February;
                    break;
                case 3:
                    month = March;
                    break;
                case 4:
                    month = April;
                    break;
                case 5:
                    month = May;
                    break;
                case 6:
                    month = June;
                    break;
                case 7:
                    month = July;
                    break;
                case 8:
                    month = August;
                    break;
                case 9:
                    month = September;
                    break;
                case 10:
                    month = October;
                    break;
                case 11:
                    month = November;
                    break;
                case 12:
                    month = December;
                    break;
            }

            int columns = 1;
            int days = month-(7-(d-1));
           while(days>0)
            {
                days = days - 7;
                columns = columns + 1;

            }
            Console.WriteLine(columns);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace Codeforces
{
    class A
    {
        private static ThreadStart s_threadStart = new A().Go;

        private void Go()
        {
            int m = GetInt();
            int d = GetInt();

            int days = 0;
            switch (m)
            {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
                    days = 31; break;
                case 2:
                    days = 28; break;
                default:
                    days = 30; break;
            }

            if (d == 1)
            {
                Wl((days + 6) / 7);
                return;
            }

            int ans = 1;
            days -= (7 - d + 1);
            ans += (days + 6) / 7;

            Wl(ans);
        }

        #region Template

        private static StringBuilder output = new StringBuilder();

        public static void Main(string[] args)
        {
            System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
            output.Length = 0;
            Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);
            timer.Start();
            main.Start();
            main.Join();
            Console.Write(output);
            timer.Stop();
            Console.Error.WriteLine(timer.ElapsedMilliseconds);
        }

        private static IEnumerator<string> ioEnum;
        private static string GetString()
        {
            do
            {
                while (ioEnum == null || !ioEnum.MoveNext())
                {
                    ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();
                }
            } while (string.IsNullOrEmpty(ioEnum.Current));

            return ioEnum.Current;
        }

        private static int GetInt()
        {
            return int.Parse(GetString());
        }

        private static long GetLong()
        {
            return long.Parse(GetString());
        }

        private static double GetDouble()
        {
            return double.Parse(GetString());
        }

        private static List<int> GetIntArr(int n)
        {
            List<int> ret = new List<int>(n);
            for (int i = 0; i < n; i++)
            {
                ret.Add(GetInt());
            }
            return ret;
        }

        private static void Wl<T>(T o)
        {
            W(o);
            output.Append(Console.Out.NewLine);
        }

        private static void Wl<T>(IEnumerable<T> enumerable)
        {
            W(enumerable);
            output.Append(Console.Out.NewLine);
        }

        private static void W<T>(T o)
        {
            if (o is double)
            {
                Wd((o as double?).Value, "");
            }
            else if (o is float)
            {
                Wd((o as float?).Value, "");
            }
            else
                output.Append(o.ToString());
        }

        private static void W<T>(IEnumerable<T> enumerable)
        {
            W(string.Join(" ", enumerable.Select(e => e.ToString()).ToArray()));
        }

        private static void Wd(double d, string format)
        {
            W(d.ToString(format, CultureInfo.InvariantCulture));
        }

        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mo
{
    class Program
    {
        static Dictionary<int, int> visited = new Dictionary<int, int>();
        public static bool Bfs(Dictionary<int, List<int>> graph, int from)
        {

            Queue<int> queue = new Queue<int>();

            queue.Enqueue(from);
            visited[from] = 1;
            while (queue.Count() > 0)
            {
                int front = queue.Peek();

                List<int> values;

                if (graph.TryGetValue(front, out values))
                {

                    foreach (var item in values)
                    {
                        if (!visited.ContainsKey(item))
                        {
                            visited[item] = 1;
                            queue.Enqueue(item);
                        }
                    }
                }

                queue.Dequeue();

            }

            return false;
        }

        private static bool IsPrime(int num)
        {
            if (num <= 1)
            {
                return false;
            }

            double num_sqrt = Math.Sqrt(num);
            int num_fl = Convert.ToInt32(Math.Floor(num_sqrt));

            for (int i = 2; i <= num_fl; i++)
            {
                if (num % i == 0)
                {
                    return false;
                }
            }
            return true;
        }

        public class helper
        {
            public int order;
            public char character;
        }

        static void Main(string[] args)
        {

            var node = GetIntegerInputsFromLine();

            var month = node[0];
            var dayofweek = node[1];

            var result = dayofweek - 1;

            var day = days(month)+ result;

            var results = Math.Ceiling((double)day / 7);

            Console.WriteLine(results);

        }

        public static int days(int m)
        {
            if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
            {
                return 31;
            }
            if (m == 2)
            {
                return 28;
            }
            return 30;
        }

        public static IDictionary<TKey, List<TValue>> AddOrUpdate<TKey, TValue>(IDictionary<TKey, List<TValue>> dictionary, TKey key, TValue value)
        {
            List<TValue> values;

            if (dictionary.TryGetValue(key, out values))
            {
                values.Add(value);

                dictionary[key] = values;
            }
            else
            {
                values = new List<TValue>();
                values.Add(value);
                dictionary[key] = values;
            }

            return dictionary;
        }

        static int GetIntegerInputFromLine()
        {
            var input = Convert.ToInt32(Console.ReadLine().Trim());
            return input;
        }

        static int[] GetIntegerInputsFromLine()
        {
            var inputs = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x.Trim())).ToArray();
            return inputs;
        }

        static long GetLongInputFromLine()
        {
            var input = Convert.ToInt64(Console.ReadLine().Trim());
            return input;
        }

        static long[] GetLongInputsFromLine()
        {
            var inputs = Console.ReadLine().Split(' ').Select(x => Convert.ToInt64(x.Trim())).ToArray();
            return inputs;
        }

        static double GetDoubleInputFromLine()
        {
            var input = Convert.ToDouble(Console.ReadLine().Trim());
            return input;
        }

        static double[] GetDoubleInputsFromLine()
        {
            var inputs = Console.ReadLine().Split(' ').Select(x => Convert.ToDouble(x.Trim())).ToArray();
            return inputs;
        }

        static string GetStringInputFromLine()
        {
            var input = Console.ReadLine();
            return input;
        }

        static string[] GetStringInputsFromLine()
        {
            var inputs = Console.ReadLine().Split(' ');
            return inputs;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] days = {31,28,31,30,31,30,31,31,30,31,30,31};
            int[] k = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            Console.WriteLine((days[k[0]-1]-(8-k[1]))/7+((days[k[0] - 1] - (8 - k[1]))%7==0?0:1)+1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace codeforces
{
	class Program
	{
		public const int Osn = 1000000007;

		public class Pair
		{
			public long First;

			public long Second;
		}

		public class PairComparer : IComparer<Pair>
		{
			public int Compare(Pair x, Pair y)
			{
				if (x.First < y.First || (x.First == y.First && x.Second > y.Second))
					return -1;
				return 1;
			}
		}

		public static long GetGcd(long a, long b)
		{
			while (true)
			{
				if (b == 0)
					return a;
				var a1 = a;
				a = b;
				b = a1 % b;

			}
		}

		public static void WriteYesNo(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string ReadString()
		{
			return Console.ReadLine();
		}

		public static List<int> ReadListOfInts()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static List<long> ReadListOfLongs()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(long.Parse).ToList();
		}

		public static int ReadInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static long ReadLong()
		{
			var s = Console.ReadLine();
			return long.Parse(s);
		}

		public class Vertex
		{
			public int Was;

			public List<int> Edges;
		}

		public static List<Vertex> Graph = new List<Vertex>();

		public static bool Dfs(int u)
		{
			if (Graph[u].Was == 1) return true;
			if (Graph[u].Was == 2) return false;
			Graph[u].Was = 1;
			foreach (var t in Graph[u].Edges)
			{
				if (Dfs(t)) return true;
			}

			Graph[u].Was = 2;
			return false;
		}

		public static bool IsPrime(int x)
		{
			for (var j = 2; j * j <= x; ++j)
				if (x % j == 0)
					return false;
			return true;
		}

		public class LinkedVertex
		{
			public int Next;

			public int Prev;

			public int Value;
		}

		public static int BinarySearch(List<int> list, int value)
		{
			var l = -1;
			var r = list.Count;
			while (r - l > 1)
			{
				var m = (r + l) / 2;
				if (list[m] >= value)
					r = m;
				else
					l = m;
			}

			return r;
		}

		public static Dictionary<long, long> mp = new Dictionary<long, long>();
		public static long Go(long u, long v, long w)
		{
			long ans = 0;
			while (u != v)
				if (u > v)
				{
					if (!mp.ContainsKey(u))
						mp.Add(u, 0);
					ans += mp[u];
					mp[u] += w;
					u /= 2;
				}
				else
				{
					if (!mp.ContainsKey(v))
						mp.Add(v, 0);
					ans += mp[v];
					mp[v] += w;
					v /= 2;
				}
			return ans;
		}

		public static int GetAns(int x, int pow)
		{
			if (pow == 0)
				return 1;
			if (pow % 2 == 1)
				return (GetAns(x, pow - 1) * 8) % 10;
			var t = GetAns(x, pow / 2);
			return (t * t) % 10;
		}

		private static void Main()
		{
/*			var input = new StreamReader("input.txt");*/
/*			var output = new StreamWriter("output.txt");*/
			var l = ReadListOfInts();
			var m = l[0];
			var d = l[1];
			var days = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
			var ct = days[m - 1] + d - 1;
			Console.WriteLine(ct / 7 + (ct % 7 != 0 ? 1 : 0));
			Console.ReadLine();
/*		input.Close();*/
/*			output.Close();*/
		}
	}
}

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;

namespace Server
{
    class Program
    {
        static void Main(string[] args)
        {

            var temp = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int m = temp[0];
            int amountDays;
            if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
                amountDays = 31;
            else if (m == 2)
                amountDays = 28;
            else
                amountDays = 30;

            Console.WriteLine(Math.Ceiling((double)(amountDays + temp[1] - 1) / 7));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4 ||s[1]==5)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                if ( s[1] == 7)
                {
                    Console.WriteLine(6);

                }
                else
                {
                    Console.WriteLine(5);
                }

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static Func<string[]> NextBuf = () => { return Console.ReadLine().Split(' '); };
    static T[] ConvertTo<T>(string[] buf)
    {
        return (buf.Select(x => (T)Convert.ChangeType(x, typeof(T)))).ToArray();
    }
    static void Main(string[] args)
    {
        int[] key = new int[12] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        int[] buf = ConvertTo<int>(NextBuf());
        int[,] tabl = new int[7, 6];
        for (int i = 1; i <= key[buf[0] - 1]; ++i)
        {
            tabl[(buf[1] - 2 + i) % 7, (buf[1] - 2 + i) / 7] = i;
        }
        int max = 0;
        for(int i = 0; i < 6; ++i)
        {
            for (int j = 0; j < 7; ++j)
            {
                if (tabl[j, i] != 0)
                {
                    ++max;
                    break;
                }
            }
        }
        Console.WriteLine(max);
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

class Program
{
    private static int[] days = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    static void Main(string[] args)
    {
        int m = RI();
        int d = RI();

        int offset = d - 1;

        int dd = days[m - 1] + offset;

        int count = (dd + 6) / 7;
        Console.WriteLine(count);

    }

    private const int Mod = 1000000000 + 7;

    #region Data Read
    private static char ReadSign()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans == '+' || ans == '-' || ans == '?')
                return (char)ans;
        }
    }

    private static long GCD(long a, long b)
    {
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }

    private static List<int>[] ReadGraph(int n, int m)
    {
        List<int>[] g = new List<int>[n];
        for (int i = 0; i < g.Length; i++) g[i] = new List<int>();
        for (int i = 0; i < m; i++)
        {
            int a = RI() - 1;
            int b = RI() - 1;

            g[a].Add(b);
            g[b].Add(a);
        }

        return g;
    }

    private static int[,] ReadGraphAsMatrix(int n, int m)
    {
        int[,] matrix = new int[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = RI();
            int b = RI();
            matrix[a, b] = matrix[b, a] = 1;
        }

        return matrix;
    }

    private static void Sort(ref int a, ref int b)
    {
        if (a > b) Swap(ref a, ref b);
    }

    private static void Swap(ref int a, ref int b)
    {
        int tmp = a;
        a = b;
        b = tmp;
    }

    private const int BufferSize = 1 << 16;
    private static StreamReader consoleReader;
    private static MemoryStream testData;

    private static int RI()
    {
        int ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static ulong RUL()
    {
        ulong ans = 0;
        int chr;
        do
        {
            chr = consoleReader.Read();
            if (chr == -1)
                return 0;
        } while (chr < '0' || chr > '9');

        ans = (uint)(chr - '0');
        while (true)
        {
            chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans;
            ans = ans * 10 + (uint)(chr - '0');
        }
    }

    private static long RL()
    {
        long ans = 0;
        int mul = 1;
        do
        {
            ans = consoleReader.Read();
            if (ans == -1)
                return 0;
            if (ans == '-') mul = -1;
        } while (ans < '0' || ans > '9');

        ans -= '0';
        while (true)
        {
            int chr = consoleReader.Read();
            if (chr < '0' || chr > '9')
                return ans * mul;
            ans = ans * 10 + chr - '0';
        }
    }

    private static int[] RIA(int n)
    {
        int[] ans = new int[n];
        for (int i = 0; i < n; i++)
            ans[i] = RI();
        return ans;
    }

    private static long[] RLA(int n)
    {
        long[] ans = new long[n];
        for (int i = 0; i < n; i++)
            ans[i] = RL();
        return ans;
    }

    private static char[] ReadWord()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        List<char> s = new List<char>();
        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s.ToArray();
    }

    private static char[] ReadString(int n)
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')));

        char[] s = new char[n];
        int pos = 0;
        do
        {
            s[pos++] = (char)ans;
            if (pos == n) break;
            ans = consoleReader.Read();
        } while ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'));

        return s;
    }

    private static char[] ReadStringLine()
    {
        int ans;

        do
        {
            ans = consoleReader.Read();
        } while (ans == 10 || ans == 13);

        List<char> s = new List<char>();

        do
        {
            s.Add((char)ans);
            ans = consoleReader.Read();
        } while (ans != 10 && ans != 13 && ans != -1);

        return s.ToArray();
    }

    private static char ReadLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if ((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z'))
                return (char)ans;
        }
    }
    private static char ReadNonLetter()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z')))
                return (char)ans;
        }
    }

    private static char ReadAnyOf(IEnumerable<char> allowed)
    {
        while (true)
        {
            char ans = (char)consoleReader.Read();
            if (allowed.Contains(ans))
                return ans;
        }
    }

    private static char ReadDigit()
    {
        while (true)
        {
            int ans = consoleReader.Read();
            if (ans >= '0' && ans <= '9')
                return (char)ans;
        }
    }

    private static int ReadDigitInt()
    {
        return ReadDigit() - (int)'0';
    }

    private static char ReadAnyChar()
    {
        return (char)consoleReader.Read();
    }

    private static string DoubleToString(double x)
    {
        return x.ToString(CultureInfo.InvariantCulture);
    }

    private static double DoubleFromString(string x)
    {
        return double.Parse(x, CultureInfo.InvariantCulture);
    }

    static Program()
    {
        //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);
    }

    private static void PushTestData(StringBuilder sb)
    {
        PushTestData(sb.ToString());
    }
    private static void PushTestData(string data)
    {
#if TOLYAN_TEST
        if (testData == null)
        {
            testData = new MemoryStream();
            consoleReader = new StreamReader(testData);
        }

        var pos = testData.Position;
        var bytes = Encoding.UTF8.GetBytes(data);
        testData.Write(bytes, 0, bytes.Length);
        testData.Flush();
        testData.Position = pos;
#endif
    }
    #endregion
}

using System;
using System.Linq;

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] md = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int[] m = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            int weeks = 1;
            int days = m[md[0] - 1] - (8 - md[1]);
            weeks += days / 7 + (days % 7 > 0 ? 1 : 0);
            Console.WriteLine(weeks);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Numerics;
using static Template;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        int M, D;
        sc.Make(out M, out D);
        var d = new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        WriteLine((d[M - 1]-(8-D)+6) / 7+1);
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) == 1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) == -1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}

public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    //public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    //public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    //public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}
public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] mouth = new int[] { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            int total = 1;

            string line = Console.ReadLine();

            int m = int.Parse(line.Split(' ')[0]),
                d = int.Parse(line.Split(' ')[1]);

            d = mouth[m] - (8 - d);

            //Console.WriteLine("{0} {1}", d, (decimal)d/7);
            total += (int)Math.Ceiling((decimal)d / 7);

            Console.WriteLine(total);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gabriel_and_Worm
{
    class Program
    {
        string RowNum = "";
        string ColNum = "";
        static void Main(string[] args)
        {

            string[] token = Console.ReadLine().Split();
            int m = int.Parse(token[0]);
            int d = int.Parse(token[1]);
            int[] months = new int[12]{31,28,31,30,31,30,31,31,30,31,30,31};
            int ans = 1;
            int day = d;
             ans = ((d-1)+months[m-1]-1)/7+1;

            Console.WriteLine(ans);

        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml.Xsl;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] {' ', '}', '{', ','}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			int m = inputs1[0];
			int d = inputs1[1];

			if (m == 2)
			{
				if (d == 1)
				{
					Console.WriteLine(4);
					return;
				}

				Console.WriteLine(5);
				return;
			}

			if (d < 6)
			{
				Console.WriteLine(5);
				return;
			}

			if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
			{
				Console.WriteLine(6);
			}
			else
			{
				if (d == 7)
				{
					Console.WriteLine(6);
					return;
				}

				Console.WriteLine(5);
			}
		}

		public class Team
		{
			public string Name { get; set; }

			public int Points { get; set; }

			public int GoalsFor { get; set; }

			public int GoalsAgainst { get; set; }
		}

		static long Factorial(long a)
		{
			return a > 1 ? a * Factorial(a - 1) : 1;
		}
	}
}

using System;

class A
{
  public static void Main()
  {
    int[] mouth = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int total = 0;

    string line = Console.ReadLine();

    int m = int.Parse(line.Split(' ')[0]),
        d = int.Parse(line.Split(' ')[1]);

    d =  mouth[d] - (8-d);
    total = (int)Math.Ceiling((decimal)d / 7) + 1;

    Console.WriteLine(total);
  }
}

using System;

class A
{
  public static void Main()
  {
    int[] mouth = new int[]{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int total = 0;

    string line = Console.ReadLine();

    int m = int.Parse(line.Split(' ')[0]),
        d = int.Parse(line.Split(' ')[1]);

    d =  mouth[d] - (7-d);
    total = Math.Abs(d / 7) + 1;

    Console.WriteLine(total);
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Task2
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            var m = arr[0];
            var d = arr[1];

            int days;

            if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
                days = 31;
            else
                days = 30;

            if (m == 2)
                days = 29;

            var cols = days - (8 - d);
            int res = 0;

            if (cols % 7 == 0)
            {
                res = cols / 7 + 1;
            }
            else
            {
                res = cols / 7 + 2;
            }

            Console.Write(res);
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

namespace CF317
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
			//using (var sw = new StreamWriter("output.txt"))
			{
				task.Solve(sr, sw);

				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var m = input[0];
			var d = input[1];
			var totalDays = m % 2 == 1 ? 31 : 30;
			if (m == 2) {
				totalDays = 28;
			}
			var cols = 1;
			var dayOfWeek = d;
			while (totalDays > 0) {
				dayOfWeek++;
				if (dayOfWeek > 7) {
					dayOfWeek = 1;
					cols++;
				}
				totalDays--;
			}

			sw.WriteLine(cols);
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
				.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
				.Select(s => func(s, CultureInfo.InvariantCulture))
				.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
				str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
						.Select(s => func(s, CultureInfo.InvariantCulture))
						.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose)
		{
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class cf001
{
    static void Main()
    {
        string input = Console.ReadLine();
        int month = int.Parse(input.Split()[0]);
        int weekday = int.Parse(input.Split()[1]);
        int result;
        List<int> months = new List<int>() { 1, 3, 5, 7, 8, 10, 12 };

        if (month == 2 && weekday == 1)
        {
            result = 4;
        }
        else if ((months.Contains(month)&& weekday > 5) ||(weekday>6))
        {
            result = 6;
        }else
        {
            result = 5;
        }

        Console.WriteLine(result);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Task1
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();

            var month = input[0];
            var firstDayInMoth = input[1];

            var daysInMonth = DateTime.DaysInMonth(2001, month);
            var daysInFirstWeek = 7 - firstDayInMoth + 1;

            var weeks = (daysInMonth - daysInFirstWeek) / 7;

            var rest = daysInMonth % 7;
            if (rest == daysInFirstWeek) weeks += 1;
            else weeks += 2;

            Console.WriteLine(weeks);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1||s[0]==3||s[0]==5||s[0]==7||s[0]==8||s[0]==10||s[0]==12 )
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else
                {
                    Console.WriteLine(5);
                }

            }
         //29--->2
            else if  (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }

            //30
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4 ||s[1]==5)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                if (s[0] == 4 && s[1] == 7)
                {
                    Console.WriteLine(6);

                }
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1||s[0]==3||s[0]==5||s[0]==7||s[0]==8||s[0]==10||s[0]==12&&s[1]==6||s[1]==7)
            {
                Console.WriteLine(6);
            }
         //29--->2
             if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
           //30
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1||s[0]==3||s[0]==5||s[0]==7||s[0]==8||s[0]==10||s[0]==12&&s[1]==6||s[1]==7)
            {
                Console.WriteLine(6);

            }
         //29--->2
           else if  (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
           //30
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4 ||s[1]==5)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == s[1])
            {
                Console.WriteLine(5);
            }
          else  if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4 ||s[1]==5)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                if (s[0] == 4 && s[1] == 7)
                {
                    Console.WriteLine(6);

                }
                else
                {
                    Console.WriteLine(5);
                }

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1||s[0]==3||s[0]==5||s[0]==7||s[0]==8||s[0]==10||s[0]==12 )
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else
                {
                    Console.WriteLine(5);
                }

            }
         //29--->2
            else if  (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] >= 1 && s[1] == 6 || s[1] == 7)
            {
                Console.WriteLine(6);

            }
            //30
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1||s[0]==3||s[0]==5||s[0]==7||s[0]==8||s[0]==10||s[0]==12||s[0]==2||s[0]==4||s[0]==6||s[0]==11||s[0]==9)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else
                {
                    Console.WriteLine(5);
                }

            }
         //29--->2
            else if  (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }

            //30
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }
            //31---->1,3,5,7,8,10,12
            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }
            else
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petr_calendar760A
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] x = Console.ReadLine().Split(' ');

            int[] s = new int[2];

            for (int i = 0; i < 2; i++)
            {
                s[i] = int.Parse(x[i]);
            }

            if (s[0] == 1 || s[0] == 3 || s[0] == 5 || s[0] == 7 || s[0] == 8 || s[0] == 10 || s[0] == 12)
            {
                if (s[1] == 6 || s[1] == 7)
                {
                    Console.WriteLine(6);
                }
                else if (s[1] == 1 || s[1] == 2 || s[1] == 3 || s[1] == 4 ||s[1]==5)
                {
                    Console.WriteLine(5);

                }
            }
            else if (s[0] == 2 && s[1] == 1)
            {
                Console.WriteLine(4);
            }
            else if (s[0] == 2 && s[1] != 1)
            {
                Console.WriteLine(5);
            }

            else if(s[0] == 4 || s[0] == 6 || s[0] == 9|| s[0] == 11 )
            {
                if (s[0] == 4 || s[1] == 7)
                {
                    Console.WriteLine(6);

                }
                else
                Console.WriteLine(5);

            }
            Console.ReadLine();

        }
    }
}

using System;

using static System.Console;
class Solution
{
    static void Main(string[] args)
    {
        int[] a = Array.ConvertAll(ReadLine().Split(), int.Parse);
        int days = DateTime.DaysInMonth(2021, a[0]);
        int weeks = days > 28 ? 5 : 4;
        weeks += 8-a[1] >= days - 28  ? 0 : 1;
        WriteLine(weeks);
    }

}

using System;
using System.Linq;

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] md = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int[] m = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            int days = m[md[0] - 1];
            int weeks = 0;
            int c = md[1];
            int cc = 1;
            while(days >= cc)
            {
                if (c == 7)
                {
                    weeks++;
                    c = 1;

                }

                cc++;
                c++;
            }

            Console.WriteLine(weeks);
        }
    }
}

using System;
using System.Linq;

namespace NetExperiment
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] md = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int[] m = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            int days = m[md[0] - 1];
            int weeks = 0;
            int c = md[1];
            int cc = 1;
            while(days >= cc)
            {
                cc++;
                c++;
                if (c >= 7)
                {
                    weeks++;
                    c = 1;
                }
            }

            Console.WriteLine(weeks);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml.Xsl;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] {' ', '}', '{', ','}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			int m = inputs1[0];
			int d = inputs1[1];

			if (m == 2)
			{
				Console.WriteLine(4);
				return;
			}

			if (d < 6)
			{
				Console.WriteLine(5);
				return;
			}

			if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
			{
				Console.WriteLine(6);
			}
			else
			{
				if (d == 7)
				{
					Console.WriteLine(6);
					return;
				}

				Console.WriteLine(5);
			}
		}

		public class Team
		{
			public string Name { get; set; }

			public int Points { get; set; }

			public int GoalsFor { get; set; }

			public int GoalsAgainst { get; set; }
		}

		static long Factorial(long a)
		{
			return a > 1 ? a * Factorial(a - 1) : 1;
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml.Xsl;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();

			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] {' ', '}', '{', ','}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
			//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();

			int m = inputs1[0];
			int d = inputs1[1];

			if (m == 2)
			{
				if (d == 1)
				{
					Console.WriteLine(5);
					return;
				}

				Console.WriteLine(4);
			}

			if (d < 6)
			{
				Console.WriteLine(5);
				return;
			}

			if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
			{
				Console.WriteLine(6);
			}
			else
			{
				if (d == 7)
				{
					Console.WriteLine(6);
					return;
				}

				Console.WriteLine(5);
			}
		}

		public class Team
		{
			public string Name { get; set; }

			public int Points { get; set; }

			public int GoalsFor { get; set; }

			public int GoalsAgainst { get; set; }
		}

		static long Factorial(long a)
		{
			return a > 1 ? a * Factorial(a - 1) : 1;
		}
	}
}