using System;
using System.Windows.Forms;

namespace _4_8
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i, n = Convert.ToInt32(textBox1.Text);
            double a = 1, b = 5, c = 0;

            if (n == 1)
                MessageBox.Show(a.ToString());
            else if (n == 2)
                MessageBox.Show(b.ToString());
            else
            {
                for (i = 2; i < n; i++)
                {
                    c = (a + b) / 2;
                    a = b;
                    b = c;
                }
                MessageBox.Show(c.ToString());
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}