import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

public class sample {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        System.out.println(n+n/2);
    }
}


import java.io.PrintWriter;
import java.util.Locale;
import java.util.Scanner;

public class A {
	public static void main (String[] args){
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = in.nextInt();

		out.printf(Locale.US, "%d", n/2*3);

		out.close();
	}
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Saransh
 */
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        try
        {
            Parserdoubt pd=new Parserdoubt(System.in);
            //BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int n=pd.nextInt();
            PrintWriter pw=new PrintWriter(System.out);
            pw.println((n*3)/2);
            pw.flush();
        }
        catch(Exception e)
        {}

    }

}

class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.IOException;
import java.util.Scanner;

public class A {
	public static void main(String args[]) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		System.out.println((2*n) - (n/2));

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Mostafa
 */
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        System.out.println((n/2) *3);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * May 13, 2011
 * @author parisel
 */
public class ToyArmy {
    int N;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] tok;
    String s;

    private String[] getTok() throws IOException {return br.readLine().split(" ");}
    private int getInt() throws IOException {return Integer.valueOf(br.readLine());}
    private int[] getInt(int N) throws IOException {
        int[] data= new int[N]; tok= br.readLine().split(" ");
        for (int i=0; i<N; i++) data[i]= Integer.valueOf(tok[i]);
        return data;
    }

    public void solve() throws IOException {
        int i=0, j=0;
        N= getInt();

        long kill= (3*N)/2;

        System.out.printf("%d\n", kill);

    }

    public static void main(String[] args) throws IOException {
        new ToyArmy().solve();
    }
}


import java.util.*;

import java.lang.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;

public class Main {

    public static void main(String[] args) throws Exception{
        FastReader sc=new FastReader();
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        int n=sc.nextInt();
        HashMap<String,Integer> map=new HashMap<String,Integer>();
        for(int i=0;i<n;i++) {
            map.put(sc.next(), 1);
        }
        ArrayList<String> list=new ArrayList<String>();
        int count=0;
        if(!map.containsKey("purple")) {
            count++;
            list.add("Power");
        }
if(!map.containsKey("green")) {
    count++;
    list.add("Time");
        }

if(!map.containsKey("blue")) {
    count++;
    list.add("Space");
}

if(!map.containsKey("orange")) {
    count++;
    list.add("Soul");
}

if(!map.containsKey("red")) {
    count++;
    list.add("Reality");
}

if(!map.containsKey("yellow")) {
    count++;
    list.add("Mind");
}System.out.println(count);
    for(String s:list) {
        System.out.println(s);
    }
    }
}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(new
                 InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}


import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        String[] str = in.nextLine().split(" ");
        int a = Integer.parseInt(str[0]);
        int v = Integer.parseInt(str[1]);
        str = in.nextLine().split(" ");
        int l = Integer.parseInt(str[0]);
        int d = Integer.parseInt(str[1]);
        int w = Integer.parseInt(str[2]);

        double minTime = 0.;
        if (w >= v) {
            minTime = getTimeAfterSign(0, v, l, a);
            out.format(Locale.US, "%.6f", minTime);
            return;
        }
        double whenGetSpeedWPath = (w * w) / (2. * a);
        if (whenGetSpeedWPath >= d) {
            double time = Math.sqrt((2.0 * d) / a);
            minTime = time + getTimeAfterSign(a * time, v, l - d, a);
        } else {
            double stopPath = (v * v - w * w) / (2. * a);
            double vMaxPath = (v * v) / (2. * a);
            if (stopPath + vMaxPath > d) {
//                double topSpeed = (Math.sqrt(2. * a * d) + w) / 2;
//                minTime = (topSpeed / a) + (topSpeed - w) / a + getTimeAfterSign(w, v, l - d, a);
                double topSpeed = Math.sqrt((2. * a * d + w * w) / 2);
                minTime = (2. * topSpeed - w) / a + getTimeAfterSign(w, v, l - d, a);
            } else {
                double stopTime = (v - w) / (a + 0.);
                double getMaxTime = v / (a + 0.);
                double maxTime = (d - (stopPath + vMaxPath)) / v;
                minTime = stopTime + getMaxTime + maxTime + getTimeAfterSign(w, v, l - d, a);
            }
        }
        out.format(Locale.US, "%.6f", minTime);

    }

    double getTimeAfterSign(double startSpeed, double maxSpeed, double path, int a) {
        double maxSpeedTime = (maxSpeed - startSpeed) / a;
        double maxSpeedPath = startSpeed * maxSpeedTime + (a * maxSpeedTime * maxSpeedTime) / 2;
        if (maxSpeedPath > path) {
            return (-startSpeed + Math.sqrt(startSpeed * startSpeed + 2 * a * path)) / a;
        } else {
            return maxSpeedTime + (path - maxSpeedPath) / maxSpeed;
        }
    }
}


import java.util.Scanner;

public class Main{
	static final double eps = 1e-10;
	public static void main(String []args){
		Scanner cin = new Scanner(System.in);
		double a,v;
		double l,d,w;
		double time;

		a = cin.nextDouble();
		v = cin.nextDouble();

		l = cin.nextDouble();
		d = cin.nextDouble();
		w = cin.nextDouble();

		if(v < w + eps)
		{
			double t1 = v / a;
			double len_bond = (v * v) / (2 * a);
			if(len_bond + eps > l)
			{
				time = Math.sqrt(2 * l / a);
			}
			else
			{
				double t2 = (l - len_bond) / v;
				time = t1 + t2;
			}
			System.out.println(time);
		}
		else
		{
			double len_bondv =  (v * v) / (2 * a);
			double len_bondw = (w * w) / (2 * a);
			if(len_bondw + eps > d)
			{
				if(len_bondv + eps > l)
					time = Math.sqrt(2 * l / a);
				else{
					double t1 = v / a;
					double t2 = (l - len_bondv) / v;
					time = t1 + t2;
				}
			}
			else
			{
				double len_bonds = (v * v - w * w) / (2 * a);

				if(len_bondv + len_bonds < d + eps)
					time = v / a + (d - len_bondv - len_bonds) / v + (v - w) / a;
				else
				{
					double f = Math.sqrt(d * a + w * w / 2);
					time = f / a + (f - w) / a;
				}
				if (len_bonds + eps > l - d) {
					double lv = Math.sqrt((l - d) * 2 * a + w * w);
					time += (lv - w) / a;
				} else {
					time += (v - w) / a + (l - d - len_bonds) / v;
				}
			}

			System.out.println(time);
		}
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main
{
    public static void main(String args[]) throws IOException
    {
        new Main().run();
    }
    StreamTokenizer in;
    PrintWriter out;
    public void run() throws IOException
    {
        in =new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
          out = new PrintWriter(new OutputStreamWriter(System.out));
        /*out = new PrintWriter(new FileWriter("output.txt"));
        in =new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));*/

        solve();

        out.flush();
    }

    public double nextInt() throws IOException
    {
        in.nextToken();
        return in.nval;
    }
    public void solve() throws IOException
    {
        double a=nextInt(),v=nextInt(),l=nextInt(),d=nextInt(),w=nextInt();
        double s=w*w/(2*a);
        if(s>d || w>v)
        {
        	double t=v*v/(2*a);
        	if(t>l)
        	{
        		double f=2*l/a;
        		out.print(String.format("%.10f",Math.sqrt(f)));
        		return;
        	}
        	double f=v/a;
        	double k=(l-t)/v;
        	out.print(String.format("%.10f",f+k));
        	return;
        }
        double t;
        if((2*v*v-w*w)/(2*a)<d)
        	t=v/a+(v-w)/a+(d-(2*v*v-w*w)/(2*a))/v;
        else
        {
        double v1=Math.sqrt((2*a*d+w*w)/2);
        t=v1/a+(v1-w)/a;
        }
        double r=l-d;
        double tr=(v*v-w*w)/(2*a);
        if(tr>r)
        {
        	double t1=(-w+Math.sqrt(w*w+2*a*r))/a;
        	out.print(String.format("%.10f",t+t1));
        	return;
        }
        r-=(v*v-w*w)/(2*a);
        t+=(v-w)/a;
        out.print(String.format("%.10f",t+r/v));
    }

}


import java.io.InputStreamReader;
import java.util.Scanner;
import java.io.IOException;

public class kresz {
	public static double a;
	public static double v;
	public static double l;
	public static double d;
	public static double w;

	public static double gyorsulut (double v1, double v2) { //v1 -> v2 mennyi utat tesz meg
		return Math.abs((v2*v2-v1*v1)/(2*a));
	}
	public static double gyorsulido (double v1, double v2) { //v1 -> v2 mennyi idő
		return Math.abs((v2-v1)/a);
	}

	public static void beolvas () throws IOException {
		Scanner be = new Scanner (new InputStreamReader (System.in));
			a = be.nextDouble();
			v = be.nextDouble();
			l = be.nextDouble();
			d = be.nextDouble();
			w = be.nextDouble();
		be.close();
	}

	public static void main (String args[]) throws IOException {
			beolvas();
			double s = l; //hátralévő út
			double t = 0; //eltelt idő

			if (v <= w ||  Math.sqrt(2*a*d) <= w) { //nincs korlátozás
				if (gyorsulut(0,v) > l) {
					t+=gyorsulido(0, Math.sqrt(2*a*l));
					s = 0;
				}
				else {
					s-=gyorsulut(0,v);
					t+=gyorsulido(0,v);
				}
			}
			else {

				//gyorsuló szakaszok a korlátozásig
				if (d < gyorsulut(0,v)+gyorsulut(v,w)) {
					double x = Math.sqrt(a*(d-w*w/(2*a))+w*w);
					s-=gyorsulut(0,w)+2*gyorsulut(w,x);
					t+=gyorsulido(0,w)+2*gyorsulido(w,x);
				}
				else {
					s-=gyorsulut(0,v)+gyorsulut(w,v);
					t+=gyorsulido(0,v)+gyorsulido(w,v);
				}

				//gyorsuló szakaszok a korlátozástól
				if (gyorsulut(v,w) > l-d) {
					double y = Math.sqrt(2*a*(l-d)+w*w);
					s-= gyorsulut(w,y);
					t+=gyorsulido(w,y);
				}
				else {
					s-=gyorsulut(w,v);
					t+=gyorsulido(w,v);
				}
			}

			t+=s/v; //nem gyorsuló szakaszok ideje

			System.out.println(t);

	}

}


import java.io.*;
import java.util.*;
import java.math.*;

public class D5 {

	static int a, v, l, d;
	static double w;

	static double afterMark( int s, double w) {
		if (2 * s * a > v * v - w * w) { // ���� ��������� v. ����� ��
			return (v - w) * 1.0 / a + (s - (v * v - w * w) * 1.0 / (2 * a)) / v;
		} else { // ���������
			double megav = Math.sqrt((2 * a * s + w * w) * 1.0);
			return (megav - w) / a;
		}
	}

	public static void main(String args[]) throws IOException {
		boolean online = System.getProperty("ONLINE_JUDGE") != null;
		Scanner in = online ? new Scanner(System.in) : new Scanner(new FileReader("input.txt"));
		PrintWriter out = online ? new PrintWriter(System.out) : new PrintWriter(new FileWriter("output.txt"));

		a = in.nextInt();
		v = in.nextInt();
		l = in.nextInt();
		d = in.nextInt();
		w = (double) in.nextInt();

		double t,t1,t2;

		if (v > w) { // ����� ��������� ������, ����� ����� ���

		// ������� ������ �� �����

			if (2 * d * a > 2 * v * v - w * w) { // ���� ��������� v. ����� ��
				t1 = (2 * v - w) * 1.0 / a + (d - (2 * v * v - w * w) * 1.0 / (2 * a)) / v;
			} else if (2 * d * a > w * w) { // ���� �� ���������, �� ���� � ���� - ���������
				double topv = Math.sqrt(d * a + w * w * 1.0 / 2);
				t1 = (2 * topv - w) * 1.0 / a;
			} else { // ���� ����������� �� ������ ����� - �����, ���������
				t1 = Math.sqrt(2 * d * 1.0 / a);
				w = Math.sqrt(2 * a * d * 1.0);
			}
		// ������� ������ ����� �����
			t2 = afterMark(l - d, w);

		t = t1 + t2;

		} else {
			t = afterMark(l, 0.0);
		}

		out.println(t);
		out.flush();
		return;
	}
}


import java.util.*;
import static java.lang.Math.*;

public final class FollowTrafficRules {
    private static double[] acce(double i, double a, double v) {
        double[] r = new double[2];
        r[0] = (v - i)/a;
        r[1] = 1d/2d * a * pow(r[0], 2) + i * r[0];
        return r;
    }

    private static double solve(double i, double a, double l) {
        double e = sqrt(pow(i, 2) + 2d * a * l);
        e = a > 0 ? e : -1d * e;
        return (e - i)/a;
    }

    private static double time(double i, double a, double v, double l) {
        double[] r = acce(i, a, v);
        if (r[1] >= l) return solve(i, a, l);
        return r[0] + (l - r[1])/v;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double v = sc.nextDouble();
        double l = sc.nextDouble();
        double d = sc.nextDouble();
        double w = sc.nextDouble();

        double t = 0d;
        double[] r = acce(0, a, w);
        if (v <= w || r[1] >= d) t = time(0, a, v, l);
        else {
            t += r[0];
            t += 2d * time(w, a, v, (d - r[1])/2d);
            t += time(w, a, v, l - d);
        }

        System.out.println(t);
    }
}


import java.util.*;

public class Rules {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int a = in.nextInt();
    double maxSpeed = in.nextInt();
    double len = in.nextInt();
    double delayDist = in.nextInt();
    double delaySpeed = in.nextInt();

    double timeToDelaySpeed = delaySpeed/a;
    double timeToDelay = travelS(a, 0.0, maxSpeed, delayDist);
    //System.out.printf("timeToDelaySpeed=%.5f, timeToDelay=%.5f\n", timeToDelaySpeed, timeToDelay);
    if (timeToDelay < timeToDelaySpeed) { // we won't reach delaySpeed before delay marker
      // 2 cases: we don't reach max by time we reach end
      timeToDelay = travelS(a, 0.0, maxSpeed, len);
      double timeToMax = maxSpeed/a;
      if (timeToDelay < timeToMax) {
        System.out.printf("%.9f\n", timeToDelay);
        return;
      }
      // we do reach max, then travel at max
      double[] parts = travelA(a, 0.0, maxSpeed);
      double remainingDist = len - parts[1];
      double time = parts[0] + remainingDist / maxSpeed;
      System.out.printf("%.9f\n", time);
      return;
    }
    if (delaySpeed > maxSpeed) {
      double time = travelS(a, 0.0, maxSpeed, len);
      System.out.printf("%.9f\n", time);
      return;
    }

    // binary search to find best velocity to stop acceleration in beginning
    double lowV = delaySpeed;
    double highV = maxSpeed;
    int loopCount = 1000;
    double[] initial = null;
    double[] secondary = null;
    while (loopCount-->0) {
      double guessV = (lowV+highV)/2.0;
      initial = travelA(a, 0.0, guessV);
      secondary = travelA(a, guessV, Math.min(delaySpeed, maxSpeed));
      if (initial[1] + secondary[1] < delayDist) { // okay, we can go faster
        lowV = guessV;
      } else {
        highV = guessV;
      }
    }
    double totalTime = 0.0;
    double finalSpeed = 0.0;
    initial = travelA(a, 0.0, lowV);
    secondary = travelA(a, lowV, delaySpeed);
    totalTime = initial[0] + secondary[0];
    double totalDist = initial[1] + secondary[1];
    totalTime += (delayDist-totalDist)/maxSpeed;

    // now we have delayDist to go, and we are at delaySpeed
    totalTime += travelS(a, delaySpeed, maxSpeed, len-delayDist);
    System.out.printf("%.9f\n", totalTime);
  }

  // [0] = time in h, [1] = dist travelled, in km
  // input units are in km/h^2, km/h, km/h
  public static double[] travelA(int a, double startSpeed, double endSpeed) {
    if (startSpeed > endSpeed)
      a = -a;

    double time = (endSpeed - startSpeed) / a;
    double dist = 0.5*a*time*time + startSpeed*time;
    return new double[] {time, dist};
  }

  // returns time it takes to travel dist, with given inputs
  public static double travelS(int a, double startSpeed, double maxSpeed, double dist) {
    double timeToMax = (maxSpeed - startSpeed) / a;
    double targetTime = (-startSpeed + Math.sqrt(startSpeed*startSpeed + 2*a*dist)) / a;
    if (targetTime < timeToMax)
      return targetTime;

    double partialDist = 0.5*timeToMax*timeToMax*a + startSpeed*timeToMax;
    double remainingDist = dist - partialDist;
    targetTime = remainingDist / maxSpeed;
    return targetTime + timeToMax;
  }
}


import java.io.*;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main {

	private BufferedReader in;
	private BufferedWriter out;

	double time(double a, double l, double v0, double v) {
		double t = (v - v0) / a;
		double s = a * t * t / 2 + v0 * t;
		if (s <= l) {
			return t + (l - s) / v;
		}

		double B = v0, C = -l;
		double D = Math.sqrt(B * B - 2 * a * C);
		return (-B + D) / a;
	}

	// )(()()))(())))
	public void solve() throws Exception {
		StreamTokenizer st = new StreamTokenizer(in);
		st.nextToken();
		double a = st.nval;
		st.nextToken();
		double v = st.nval;
		st.nextToken();
		double l = st.nval;
		st.nextToken();
		double d = st.nval;
		st.nextToken();
		double w = st.nval;

		double ttt = Math.sqrt(2 * d / a);
		double ans = 0.0;

		if (w > v || ttt * a < w) {
			ans = time(a, l, 0, v);
		} else {
			double B = 2 * w / a, C = -w * w / (a * a) - 4 * d / a;
			double D = Math.sqrt(B * B - 4 * C);
			ans = (-B + D) / 2;
			if ((a * ans + w) / 2.0 > v) {
				double t1 = v / a;
				double t2 = (v - w) / a;
				double s = (a * t1 * t1 / 2.0) + (v * t2 - a * t2 * t2 / 2.0);
				ans = t1 + t2 + (d - s) / v;
			}
			ans += time(a, l - d, w, v);
		}
		DecimalFormat df = new DecimalFormat("0.000000000");
		out.write(df.format(ans) + "\n");
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		try {
			Locale.setDefault(Locale.US);
		} catch (Exception e) {
		}
		new Main().run();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException {
        double a = in.nextInt();
        double v = in.nextInt();
        double l = in.nextInt();
        double d = in.nextInt();
        double w = in.nextInt();

        if (w * w / (a * 2) > d || v < w) {
            if (v * v / (a * 2) > l) {
                out.println(Math.sqrt(l * 2 / a));
            }
            else {
                double t = v / a;
                double s = l - t * v / 2;
                t = t + s / v;
                out.println(t);
            }
            return;
        }
        double t = solveD(a, v, w, d);
        if ((v + w) * (v - w) / (a * 2) > l - d) {
            double dis = w * w + a * (l - d) * 2;
            double t1 = (Math.sqrt(dis) - w) / a;
            System.out.println(t + t1);
        }
        else {
            double t1 = (v - w) / a;
            double s = l - d - (v + w) * t1 / 2;
            double t2 = s / v;
            System.out.println(t + t1 + t2);
        }
    }

    public double solveD(double a, double vMax, double wBound, double s) {
        double v = Math.sqrt(a * s + wBound * wBound / 2);
        if (v > vMax) {
            v = vMax;
        }
        double t1 = v / a;
        double t2 = (v - wBound) / a;
        double s1 = v * t1 / 2;
        double s2 = (v + wBound) * t2 / 2;
        double sr = s - s1 - s2;
        double tr = sr / v;
        return t1 + t2 + tr;

    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            solve();
            out.close();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] arg) {
        new Main().run();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D {
    public static void main(String[] args) throws IOException {
        new D().solve();
    }

    static final double EPS = 1e-10;

    Parser parser;

    enum Result {
        UNDER, OVER
    }

    private void solve() throws IOException {
        this.parser = new Parser(new BufferedReader(new InputStreamReader(System.in)));
        double a = parser.nextInt();
        double vmax = parser.nextInt();
        double l = parser.nextInt();
        double d = parser.nextInt();
        double w = parser.nextInt();
        double low = 0;
        double high = 20000;
        while (Math.abs(high - low) > 1e-10) {
            double accelerateTime = (low + high) / 2;
            Result res = check(accelerateTime, a, vmax, d, w).result;
            if (res == Result.UNDER) {
                low = accelerateTime;
            } else {
                high = accelerateTime;
            }
        }
        IP ip = check(high, a, vmax, d, w);
        TV tv = tv(ip.v, l - d, a, vmax);
        PrintWriter pw = new PrintWriter(System.out);
        pw.printf("%.5f\n", ip.time + tv.time);
        pw.close();
    }

    private IP check(double accelerateTime, double a, double vmax, double d, double w) {
        DV dv = dv(0, a, accelerateTime, vmax);
        if (dv.d > d) {
            return new IP(accelerateTime, dv.v, Result.OVER);
        }
        Double slowTime = time2MakeDist(-a, dv.v, d - dv.d);
        if (slowTime == null) {
            return new IP(0, 0, Result.UNDER);
        }
        double vDown = dv.v - a * slowTime;
        if (vDown < w) {
            return new IP(0, 0, Result.UNDER);
        } else {
            return new IP(accelerateTime + slowTime, vDown, Result.OVER);
        }
    }

    static class IP {
        final double time;
        final double v;
        final Result result;

        IP(double time, double v, Result result) {
            this.time = time;
            this.v = v;
            this.result = result;
        }
    }

    static class DV {
        final double d;
        final double v;

        DV(double d, double v) {
            this.d = d;
            this.v = v;
        }
    }

    static class TV {
        final double time;
        final double v;

        TV(double time, double v) {
            this.time = time;
            this.v = v;
        }
    }

    static Double time2MakeDist(double a, double v0, double dist) {
        return quadric(a / 2, v0, -dist);
    }

    static TV tv(double v0, double d, double a, double vmax) {
        double acTime = (vmax - v0) / a;
        double unboundedTime = time2MakeDist(a, v0, d);
        if (unboundedTime > acTime) {
            double ad = dist(v0, a, acTime);
            return new TV(acTime + (d - ad) / vmax, vmax);
        } else {
            return new TV(unboundedTime, v0 + a * unboundedTime);
        }
    }

    static DV dv(double v0, double a, double time, double vmax) {
        double time2maxV = (vmax - v0) / a;
        if (time2maxV < time) {
            return new DV(dist(v0, a, time2maxV) + dist(vmax, 0, time - time2maxV), vmax);
        } else {
            return new DV(dist(v0, a, time), v0 + a * time);
        }
    }

    static double dist(double v0, double a, double time) {
        return v0 * time + a * time * time / 2;
    }

    static Double quadric(final double a, final double b, final double c) {
        double d = b * b - 4 * a * c;
        if (d < -EPS) {
            return null;
        }
        d = Math.abs(d);
        double x1 = (-b + Math.sqrt(d)) / (2 * a);
        double x2 = (-b - Math.sqrt(d)) / (2 * a);
        double r = Integer.MAX_VALUE;
        if (x1 > -EPS) {
            r = x1;
        }
        if (x2 > -EPS) {
            r = Math.min(r, x2);
        }
        if (r == Integer.MAX_VALUE) {
            throw new RuntimeException("BOTVA");
        }
        return r;
    }

    static class Parser {

        final BufferedReader br;
        StringTokenizer st = new StringTokenizer("");

        public Parser(BufferedReader bufferedReader) {
            this.br = bufferedReader;
        }

        String nextToken() throws IOException {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(nextToken());
        }
    }
}


import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author madis
 */
public class Rules {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double a = in.nextInt();
        double v = in.nextInt();
        double l = in.nextInt();
        double d = in.nextInt();
        double w = in.nextInt();

        if (v <= w) {
            double t = v / a;
            if (0.5 * t * t * a > l) {
                t = Math.sqrt(2 * l / a);
            } else {
                t += (l - 0.5 * t * t * a) / v;
            }
            System.out.printf("%.5f", t);

        } else {
            double total = 0.0;
            double t = v / a;
            double t2 = (v - w) / a;
            double tempt = Math.sqrt(2.0 * d / a);
            if (tempt * a <= w) {
                total += tempt;
                w = tempt*a;
            } else if (0.5 * t * t * a +v*t2 - 0.5 * t2 * t2 * a > d) {
                double as = 2.0*a;
                double bs = 4.0*w;
                double cs = ((w * w) / (a) - 2.0 * d );

                double delta = bs * bs - 4.0 * as * cs;
                double root = (-bs + Math.sqrt(delta)) / (2.0 * as);
                if (root < 0.0) {
                    root = (-bs - Math.sqrt(delta)) / (2.0 * as);
                }
                total += (2.0 * root + w / a);
            } else {
                total += t + t2;
                double smd = (d - 0.5 * t * t * a - v*t2 + 0.5 * t2 * t2 * a) / v;
                total += smd;
            }
            double t3 = (v - w) / a;
            if (w * t3 + 0.5 * t3 * t3 * a > l - d) {
                double as = 0.5 * a;
                double bs = w;
                double cs = d - l;

                double delta = bs * bs - 4.0 * as * cs;
                double root = (-bs + Math.sqrt(delta)) / (2.0 * as);
                if (root < 0.0) {
                    root = (-bs - Math.sqrt(delta)) / (2.0 * as);
                }
                total += root;
            } else {
                total += t3;
                double t4 = (l - (w * t3 + 0.5 * t3 * t3 * a) - d) / v;
                total += t4;
            }
            System.out.printf("%.5f", total);
        }
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class Solution implements Runnable {
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;
	private Random rnd;

	double Vend;

	private double calcFirstSegment(double a, double Vmax, double Vend, double l) {
		double Vl = 0, Vr = Vmax;

		for(int it = 0; it < 256; it++) {
			double Vm = (Vl + Vr) / 2.0;

			double tFirst = Vm / a;

			double tSecond = 0;
			if(Vend < Vm) tSecond = (Vm - Vend) / a;

			double firstPart = a * tFirst * tFirst / 2.0;
			double secondPart = Vm * tSecond - a * tSecond * tSecond / 2.0;

			double res = firstPart + secondPart;

			if(res < l) Vl = Vm;
			else Vr = Vm;
		}

		this.Vend = Math.min(Vl, Vend);

		double res = 0.0;

		{
			double Vm = Vl;

			double tFirst = Vm / a;
			double tSecond = 0;
			if(Vend < Vm) tSecond = (Vm - Vend) / a;

			//out.println(tSecond);

			double firstPart = a * tFirst * tFirst / 2.0;
			double secondPart = Vm * tSecond - a * tSecond * tSecond / 2.0;

			double remain = l - firstPart - secondPart;

			res = tFirst + tSecond + (remain / Vm);
		}

		return res;
	}

	private double calcSecondPart(double a, double Vmax, double Vstart, double l) {
		double Vl = Vstart, Vr = Vmax;

		//out.println(Vstart);

		for(int it = 0; it < 256; it++) {
			double Vm = (Vl + Vr) / 2.0;
			double t = (Vm - Vstart) / a;

			double s = Vstart * t + a * t * t / 2.0;

			if(s < l) Vl = Vm;
			else Vr = Vm;
		}

		double res = 0.0;

		{
			double Vm = (Vl + Vr) / 2.0;
			double t = (Vm - Vstart) / a;

			double s = Vstart * t + a * t * t / 2.0;

			double remain = l - s;

			res = t + (remain / Vmax);
		}

		return res;
	}

	public void solve() throws IOException {
		double a = nextDouble(), v = nextDouble(), l = nextDouble(), d = nextDouble(), w = nextDouble();

		double res = calcFirstSegment(a, v, w, d);
		res += calcSecondPart(a, v, Vend, l - d);

		out.println(res);
	}

	public static void main(String[] args) {
		new Solution().run();
	}

	public void run() {
		try {
			//in = new BufferedReader(new FileReader("input.txt"));
			//out = new PrintWriter(new FileWriter("output.txt"));

			in = new BufferedReader(new InputStreamReader((System.in)));
			out = new PrintWriter(System.out);

			st = null;
			rnd = new Random();

			solve();

			out.close();
		} catch(IOException e) {
			e.printStackTrace();
		}
	}

	private String nextToken() throws IOException, NullPointerException {
		while(st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}

		return st.nextToken();
	}

	private int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Berland implements Runnable {
    private void solve() throws IOException {
        double a = nextInt();
        double v = nextInt();
        double l = nextInt();
        double d = nextInt();
        double w = nextInt();
        double res;
        if (v <= w) {
            res = simpleCase(a, v, l, 0);
        } else {
            double vMax = Math.sqrt(2 * d * a);
            if (vMax <= w) {
                res = simpleCase(a, v, l, 0);
            } else {
                double tFullSpeed = v / a;
                double tSlowdown = (v - w) / a;
                if (a * tFullSpeed * tFullSpeed / 2 + v * tSlowdown - a * tSlowdown * tSlowdown / 2 <= d) {
                    res = tFullSpeed + tSlowdown + (d - (a * tFullSpeed * tFullSpeed / 2 + v * tSlowdown - a * tSlowdown * tSlowdown / 2)) / v + simpleCase(a, v, l - d, w);
                } else {
                    double min = w;
                    double max = v;
                    for (int i = 0; i < 1000; ++i) {
                        double cur = (min + max) / 2;
                        double cFullSpeed = cur / a;
                        double cSlowdown = (cur - w) / a;
                        if (a * cFullSpeed * cFullSpeed / 2 + cur * cSlowdown - a * cSlowdown * cSlowdown / 2 <= d)
                            min = cur;
                        else
                            max = cur;
                    }
                    res = min / a + (min - w) / a + simpleCase(a, v, l - d, w);
                }
            }
        }
        writer.printf("%.20f\n", res);
    }

    private double simpleCase(double a, double v, double l, double v0) {
        double tFullSpeed = (v - v0) / a;
        if (v0 * tFullSpeed + a * tFullSpeed * tFullSpeed / 2 <= l) {
            return tFullSpeed + (l - (v0 * tFullSpeed + a * tFullSpeed * tFullSpeed / 2)) / v;
        } else {
            double min = 0;
            double max = tFullSpeed;
            for (int i = 0; i < 1000; ++i) {
                double cur = (min + max) / 2;
                if (v0 * cur + a * cur * cur / 2 <= l)
                    min = cur;
                else
                    max = cur;
            }
            return min;
        }
    }

    public static void main(String[] args) {
        new Berland().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

/**
 * @author Egor Kulikov (egor@egork.net)
 *         Created on 14.03.2010
 */
public class Rules implements Runnable {
	private Scanner in = new Scanner(System.in);
	private PrintWriter out = new PrintWriter(System.out);
	private double a, v, l, d, w;
	private double ans;

	public static void main(String[] args) {
		new Thread(new Rules()).start();
	}

	public void run() {
		read();
		solve();
		write();
		out.close();
	}

	private void read() {
		a = in.nextInt();
		v = in.nextInt();
		l = in.nextInt();
		d = in.nextInt();
		w = in.nextInt();
	}

	private double remaining(double v0, double dst) {
		double t = (v - v0) / a;
		double d = a * t * t / 2 + t * v0;
		if (d > dst)
			return (Math.sqrt(v0 * v0 + 2 * a * dst) - v0) / a;
		return t + (dst - d) / v;
	}

	private void solve() {
		if (w * w >= 2 * a * d || w >= v) {
			ans = remaining(0, l);
			return;
		}
		{
			double t1 = v / a;
			double t2 = (v - w) / a;
			double dd = a * t1 * t1 / 2 + a * t2 * t2 / 2 + w * t2;
			if (dd < d) {
				ans = t1 + t2 + (d - dd) / v + remaining(w, l - d);
				return;
			}
		}
		double t1 = w / a;
		double rd = d - t1 * t1 * a / 2;
		double t2 = (Math.sqrt(w * w + a * rd) - w) / a;
		ans = t1 + 2 * t2 + remaining(w, l - d);
	}

	private void write() {
		out.printf("%.7f\n", ans);
	}
}


import java.io.*;
import java.util.*;

public class D {

	static Scanner in = new Scanner(new BufferedInputStream(System.in));
	static PrintWriter out = new PrintWriter(System.out);

	static double getTime(double v, double a, double l, double r) {
		return (-v + Math.sqrt(v * v - 2 * a * (l - r))) / a;
	}

	static double getVelocity(double v, double t, double l, double r) {
		return t == 0 ? v : (2 * (r - l)) / t - v;
	}

	public static void main(String[] args) throws IOException {
		double a = in.nextDouble(), v = in.nextDouble(), l = in.nextDouble(),
				d = in.nextDouble(), w = Math.min(v, in.nextDouble());

		double x = v * v / (2 * a), y = d - (v * v - w * w) / (2 * a),
				z = d + (v * v - w * w) / (2 * a);
		//out.println(x + " " + y + " " + z);
		double L, R, T = 0, V = 0, t;

		//OX
		L = 0;
		R = x;
		if (x > y && x < z) {
			R = (x + y) / 2;
		} else if (x > l) {
			R = l;
		}
		t = getTime(V, a, L, R);
		V = getVelocity(V, t, L, R);
		//out.println("l: " + L + ", r: " + R + ", t: " + t + ", v: " + V);
		T += t;

		//XY
		if (x < y) {
			T += (y - x) / v;
		}
		//out.println("t: " + (T - t));

		//YD
		L = y;
		R = d;
		if (x > y && x < z) {
			L = (x + y) / 2;
		} else if (x >= z) {
			L = R;
		}
		t = getTime(V, -a, L, R);
		V = getVelocity(V, t, L, R);
		T += t;
		//out.println("l: " + L + ", r: " + R + ", t: " + t + ", v: " + V);

		//DZ
		L = d;
		R = z;
		if (x >= z) {
			R = L;
		} else if (z > l) {
			R = l;
		}
		t = getTime(V, a, L, R);
		V = getVelocity(V, t, L, R);
		T += t;
		//out.println("l: " + L + ", r: " + R + ", t: " + t + ", v: " + V);

		//ZL
		L = z;
		R = l;
		if (x > z) {
			L = x;
		}
		if (L < R) {
			T += (R - L) / v;
		}

		out.format(Locale.US, "%.12f%n", T);
		out.close();
	}
}


import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.math.BigInteger;

public class Main {
	final int INF = 1000000000;
	final int MAXN = 100100;

	Scanner input = new Scanner(System.in);
	BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	double a, v;
	double l, d, w;

	void run() throws IOException {
		a = input.nextDouble();
		v = input.nextDouble();
		l = input.nextDouble();
		d = input.nextDouble();
		w = input.nextDouble();
		if (v <= w) {
			out.println(timeTravel(l, 0));
		} else {
			double tw = w / a;
			double dw = dist(tw, 0);
			if (dw >= d) {
				out.println(timeTravel(l, 0));
			} else {
				double tSym = timeTravel((d - dw) / 2, w);
				out.println(tw + 2 * tSym + timeTravel(l - d, w));
			}
		}
		out.close();
	}

	double dist(double time, double speed) {
		return speed * time + a * time * time / 2;
	}

	double timeTravel(double distance, double speed) {
		double delta = speed * speed + 2 * a * distance;
		double tAll = (Math.sqrt(delta) - speed) / a;
		double tMax = (v - speed) / a;
		if (tMax >= tAll) {
			return tAll;
		} else {
			return tMax + (distance - dist(tMax, speed)) / v;
		}
	}
}


import java.util.Scanner;

public class Task5d {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double v = sc.nextDouble();
		double l = sc.nextDouble();
		double d = sc.nextDouble();
		double w = sc.nextDouble();
		double t = 0;
		if (w >= v) {
			double t1 = v / a;
			double s1 = a * t1 * t1 / 2;
			if (s1 > l) {
				t = Math.sqrt(2 * l / a);
			} else {
				t = t1 + (l - s1) / v;
			}
		} else {
			double t2 = Math.sqrt(2 * d / a);
			if (a * t2 <= w) {
				double t1 = v / a;
				double s1 = a * t1 * t1 / 2;
				if (s1 > l) {
					t = Math.sqrt(2 * l / a);
				} else {
					t = t1 + (l - s1) / v;
				}
			} else {
				double tup = v / a;
				double tdown = (v - w) / a;
				double sup = a * tup * tup / 2;
				double sdown = v * tdown - a * tdown * tdown / 2;
				if (sup + sdown <= d) {
					double tmax = (d - sup - sdown) / v;
					t = tup + tmax + tdown;
				} else {
					double tw = w / a;
					double sw = a * tw * tw / 2;
					double sl = (d - sw) / 2;
					double dis = w * w + 2 * a * sl;
					double tu1 = (- w - Math.sqrt(dis)) / a;
					if (tu1 < 0) {
						tu1 = (- w + Math.sqrt(dis)) / a;
					}
					t = tw + 2 * tu1;
				}
				double sreup = w * tdown + a * tdown * tdown / 2;
				if (sreup <= l - d) {
					t += tdown;
					t += (l - d - sreup) / v;
				} else {
					double dis = w * w - 2 * a * (d - l);
					double tu1 = (- w - Math.sqrt(dis)) / a;
					if (tu1 < 0) {
						tu1 = (- w + Math.sqrt(dis)) / a;
					}
					t += tu1;
				}
			}
		}
		System.out.println(t);
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D5 implements Runnable {

	final double eps = 1e-9;

	private void Solution() throws IOException {
		double a = nextDouble(), v = nextDouble();
		double l = nextDouble(), d = nextDouble(), w = nextDouble();
		double t = 0;
		if (w + eps > v) {
			double s = v * v / (2 * a);
			if (s + eps > l)
				t = Math.sqrt(2 * l / a);
			else {
				double ta = v / a;
				double sa = a * ta * ta / 2;
				t = ta + (l - sa) / v;
			}
		} else {
			double sv = v * v / (2 * a);
			double sw = w * w / (2 * a);
			if (sw + eps > d) {
				if (sv + eps > l)
					t = Math.sqrt(2 * l / a);
				else {
					double ta = v / a;
					double sa = a * ta * ta / 2;
					t = ta + (l - sa) / v;
				}
			} else {
				double sd = (w * w - v * v) / (-2 * a);
				if (sv + sd < eps + d)
					t = v / a + (d - sv - sd) / v + (v - w) / a;
				else {
					double f = Math.sqrt(d * a + w * w / 2);
					t = f / a + (f - w) / a;
				}
				if (sd + eps > l - d) {
					double lv = Math.sqrt((l - d) * 2 * a + w * w);
					t += (lv - w) / a;
				} else {
					t += (v - w) / a + (l - d - sd) / v;
				}
			}
		}
		out.printf("%.12f", t);
	}

	public static void main(String[] args) {
		new D5().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			Solution();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

	void print(Object... obj) {
		for (int i = 0; i < obj.length; i++) {
			if (i != 0)
				out.print(" ");
			out.print(obj[i]);
		}
	}

	void println(Object... obj) {
		print(obj);
		print("\n");
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(next());
	}

	double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(next());
	}

	String nextLine() throws IOException {
		return in.readLine();
	}

	String next() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(nextLine());
		return tokenizer.nextToken();
	}
}


import java.io.*;

public class n5D
{
    public static void main(String[] args)
    {
        double a = 0, v = 0, l = 0, d = 0, w = 0;
        try
        {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String[] str = br.readLine().split(" ");
            a = Double.parseDouble(str[0]);
            v = Double.parseDouble(str[1]);
            str = br.readLine().split(" ");
            l = Double.parseDouble(str[0]);
            d = Double.parseDouble(str[1]);
            w = Double.parseDouble(str[2]);
        }
        catch(Exception e)
        {
            System.out.println(e);
        }

        double t1, t2, t3, t4, t5, t, D = 0;

        if (w > v) w = v;
        t2 = d / v - v / a + w * w / 2 / a / v;
        if (t2 >= 0)
        {
            t1 = v / a;
            t3 = t1 - w / a;
        }
        else
        {
            if (Math.sqrt(2 * d / a) > (w / a))
            {
                t1 = Math.sqrt((2 * a * d + w * w) / (a * a * 2));
                t3 = t1 - w / a;
            }
            else
            {
                t1 = Math.sqrt(2 * d / a);
                t3 = 0;
            }
            t2 = 0;
        }
        t5 = (l - d - v * v / 2 / a + a * (t1 - t3) * (t1 - t3) / 2) / v;
        if (t5 >= 0) t4 = v / a - (t1 - t3);
        else
        {
            t5 = 0;
            t4 = -t1 + t3 + Math.sqrt((t1 - t3) * (t1 - t3) + 2 * (l - d) / a);
        }
        t = t1 + t2 + t3 + t4 + t5;
        System.out.println(t);
        //System.out.println(t1 + " " + t2 + " " + t3 + " " + t4 + " " + t5);
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D5 {

    static StringTokenizer st;
    static BufferedReader in;
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        double a = nextInt();
        double v = nextInt();
        double L = nextInt();
        double d = nextInt();
        double w = nextInt();
        double ans = 0;
        if (w >= v)
            ans = go(0, a, L, v);
        else {
            ans = go(Math.min(w, Math.sqrt(2*a*d)), a, L-d, v);
            if (2*a*d < w*w)
                ans += Math.sqrt(2*d/a);
            else {
                if (d-v*v/(2*a) >= (v*v-w*w)/(2*a))
                    ans += v/a+(v-w)/a+(d-v*v/(2*a)-(v*v-w*w)/(2*a))/v;
                else {
                    double x = Math.sqrt((w*w+2*a*d)/2);
                    ans += x/a+(x-w)/a;
                }
            }
        }
        System.out.println(ans);
        pw.close();
    }

    private static double go(double v0, double a, double s, double vmax) {
        double t = (vmax-v0) / a;
        if (v0*t+a*t*t/2 < s)
            return t+(s-v0*t-a*t*t/2) / vmax;
        else {
            double D = v0*v0+2*a*s;
            return (-v0+Math.sqrt(D))/a;
        }
    }

    private static int nextInt() throws IOException{
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException{
        return Long.parseLong(next());
    }

    private static double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

}


import java.util.*;

public class Rules {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int a = in.nextInt();
    double maxSpeed = in.nextInt();
    double len = in.nextInt();
    double delayDist = in.nextInt();
    double delaySpeed = in.nextInt();

    // two cases: I reach the delayPoint at a speed higher than the delaySpeed, or I don't.
    double timeToDelayAtMax = travelS(a, 0.0, maxSpeed, delayDist);
    double timeToDelayAtDelay = travelS(a, 0.0, delaySpeed, delayDist);
    if (Math.abs(timeToDelayAtMax-timeToDelayAtDelay) < 0.00001) {
      // I can reach the delayPoint without being delayed
      double time = travelS(a, 0.0, maxSpeed, len);
      System.out.printf("%.9f\n", time);
      return;
    }

    // binary search to find best velocity to stop acceleration in beginning
    double lowV = delaySpeed;
    double highV = maxSpeed;
    int loopCount = 1000;
    double[] initial = null;
    double[] secondary = null;
    while (loopCount-->0) {
      double guessV = (lowV+highV)/2.0;
      initial = travelA(a, 0.0, guessV);
      secondary = travelA(a, guessV, Math.min(delaySpeed, maxSpeed));
      if (initial[1] + secondary[1] < delayDist) { // okay, we can go faster
        lowV = guessV;
      } else {
        highV = guessV;
      }
    }
    double totalTime = 0.0;
    double finalSpeed = 0.0;
    initial = travelA(a, 0.0, lowV);
    secondary = travelA(a, lowV, delaySpeed);
    totalTime = initial[0] + secondary[0];
    double totalDist = initial[1] + secondary[1];
    totalTime += (delayDist-totalDist)/maxSpeed;

    // now we have delayDist to go, and we are at delaySpeed
    totalTime += travelS(a, delaySpeed, maxSpeed, len-delayDist);
    System.out.printf("%.9f\n", totalTime);
  }

  // [0] = time in h, [1] = dist travelled, in km
  // input units are in km/h^2, km/h, km/h
  public static double[] travelA(int a, double startSpeed, double endSpeed) {
    if (startSpeed > endSpeed)
      a = -a;

    double time = (endSpeed - startSpeed) / a;
    double dist = 0.5*a*time*time + startSpeed*time;
    return new double[] {time, dist};
  }

  // returns time it takes to travel dist, with given inputs
  public static double travelS(int a, double startSpeed, double maxSpeed, double dist) {
    double timeToMax = (maxSpeed - startSpeed) / a;
    double targetTime = (-startSpeed + Math.sqrt(startSpeed*startSpeed + 2*a*dist)) / a;
    if (targetTime < timeToMax)
      return targetTime;

    double partialDist = 0.5*timeToMax*timeToMax*a + startSpeed*timeToMax;
    double remainingDist = dist - partialDist;
    targetTime = remainingDist / maxSpeed;
    return targetTime + timeToMax;
  }
}


import java.io.*;
import java.util.*;

public class D {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	double f(int dist, double initSp, int a, int maxSp) {
		double distToReachMaxSpeed = 0.5 * (maxSp * maxSp - initSp * initSp)
				/ a;

		if (dist > distToReachMaxSpeed)
			return 1d * (maxSp - initSp) / a + (dist - distToReachMaxSpeed)
					/ maxSp;

		return (Math.sqrt(initSp * initSp + 2 * a * dist) - initSp) / a;
	}

	void solve() throws IOException {
		int a = nextInt();
		int maxSp = nextInt();
		int len = nextInt();
		int signX = nextInt();
		int signSp = nextInt();

		if (maxSp <= signSp) {
			out.printf("%.9f\n", f(len, 0, a, maxSp));
			return;
		}

		double distToReachSignSp = 0.5 * signSp * signSp / a;
		if (distToReachSignSp >= signX) {
			out.printf("%.9f\n", f(len, 0, a, maxSp));
			return;
		}

		double distToReachMaxThenSign = 0.5
				* (maxSp * maxSp + maxSp * maxSp - signSp * signSp) / a;
		if (distToReachMaxThenSign <= signX) {
			double t = 1d * (2 * maxSp - signSp) / a
					+ (signX - distToReachMaxThenSign) / maxSp
					+ f(len - signX, signSp, a, maxSp);
			out.printf("%.9f\n", t);
			return;
		}

		double xSp = Math.sqrt(a * signX + signSp * signSp * 0.5);
		double xTime = (2 * xSp - signSp) / a;
		out.printf("%.9f\n", xTime + f(len - signX, signSp, a, maxSp));
	}

	void inp() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new D().inp();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}


import java.util.*;
import java.io.*;

public class D0005 {

    public static void main(String args[]) throws Exception {
        new D0005();
    }

    D0005() throws Exception {
        PandaScanner sc = null;
        PrintWriter out = null;
        try {
            sc = new PandaScanner(System.in);
            out = new PrintWriter(System.out);
        } catch (Exception ignored) {
        }

        a = sc.nextInt();
        max = sc.nextInt();

        double length = sc.nextInt();
        double dist = sc.nextInt();
        double limit = sc.nextInt();

        if (max <= limit) {
            out.println(travelTime(length, 0));
        }
        else {
            double tLimit = limit / a;
            double dLimit = distance(0, tLimit);
            if (dLimit >= dist) {
                out.println(travelTime(length, 0));
            }
            else {
                double res = tLimit + 2 * (travelTime(0.5 * (dist - dLimit), limit)) +
                        travelTime(length - dist, limit);
                out.println(res);
            }
        }

        out.close();
        System.exit(0);
    }
    double a, max;
    double distance(double v, double t) {
        return v * t + 0.5 * a * t * t;
    }
    double travelTime(double d, double v) {
        double tAll = (-v + Math.sqrt(v * v + 2 * a * d)) / a;
        double tMax = (max - v) / a;
        if (tAll <= tMax) {
            return tAll;
        }
        else {
            return tMax + (d - distance(v, tMax)) / max;
        }
    }

    //The PandaScanner class, for Panda fast scanning!
    public class PandaScanner {
        BufferedReader br;
        StringTokenizer st;
        InputStream in;

        PandaScanner(InputStream in) throws Exception {
            br = new BufferedReader(new InputStreamReader(this.in = in));
        }

        public String next() throws Exception {
            if (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine().trim());
                return next();
            }
            return st.nextToken();
        }

        public boolean hasNext() throws Exception {
            return (st != null && st.hasMoreTokens()) || in.available() > 0;
        }

        public long nextLong() throws Exception {
            return Long.parseLong(next());
        }

        public int nextInt() throws Exception {
            return Integer.parseInt(next());
        }
    }
}


import java.util.*;
import java.io.*;

public class Traffic extends Template{
	public double search1(int a, int w, int d){
		double s = 0;
		double l = 2*w+2*a*d;
		int repeat = 100;
		while( repeat-- > 0 ){
			double x = (s+l)/2;
			if( a*a*x*x + 2*a*w*x - w*w - 4*a*d > 0 ){
				l = x;
			} else {
				s = x;
			}
		}
		return l;
	}

	public double search2(int a, double lim, int k){
		double s = 0;
		double l = lim + 2*a*k;
		int repeat = 100;
		while( repeat-- > 0 ){
			double x = (s+l)/2;
			if( a*x*x + 2*lim*x - 2*k > 0 ){
				l = x;
			} else {
				s = x;
			}
		}
		return l;
	}

	public void solve() throws IOException {
		int a = nextInt();
		int v = nextInt();
		int l = nextInt();
		int d = nextInt();
		int w = nextInt();
		if( w > v ){
			w = v;
		}
		double time_max = Math.sqrt((double)2*d/a);
		double time_d = search1(a,w,d);
	//	writer.println(time_max*a < w); writer.println(v <= (w+a*time_d)/2); writer.println(w < v);
		double t1 = (time_max*a < w) ? time_max : (v >= (w+a*time_d)/2) ? time_d : (w < v) ? (double)(2*v*v-2*v*w+2*a*d+w*w)/(2*a*v) : (double)v/a + (double)(d-(double)v*v/(2*a))/v;
		double lim = (time_max*a < w) ? time_max*a : w;
		double t3 = Math.min((double)(v-lim)/a, search2(a, lim, l-d));
//		double t = (Math.sqrt(limit*limit+2*a*(l-d))-limit)/a;
		double dist2 = (l-d) - t3*t3*a/2 - t3*lim;
		double t4 = dist2/v;
//		writer.println("t1 = " + t1);
//		writer.println("dist1 = " + dist1);
//		writer.println("t3 = " + t3);
//		writer.println("dist2 = " + dist2);
//		writer.println("t4 = " + t4);
		writer.println((t1+t3+t4));
	}

	public static void main(String[] args){
		new Traffic().run();
	}
}

abstract class Template implements Runnable{
	public abstract void solve() throws IOException;

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run(){
		try{
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch(Exception e){
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}

	public String nextToken() throws IOException{
		while( tokenizer == null || !tokenizer.hasMoreTokens() ){
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;

public class Main implements Runnable {

    static Throwable sError;

    public static void main(String[] args) throws Throwable {
        Thread t = new Thread(new Main());
        t.start();
        t.join();
        if (sError != null)
            throw sError;
    }

    PrintWriter pw;
    BufferedReader in;
    StringTokenizer st;

    void initStreams() throws FileNotFoundException,
            UnsupportedEncodingException {
        pw = new PrintWriter(System.out);
        if (System.getProperty("ONLINE_JUDGE") == null) {
            System.setIn(new FileInputStream("1"));
        }
        in = new BufferedReader(new InputStreamReader(System.in, "ISO-8859-9"));
    }

    String nextString() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextString());
    }

    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextString());
    }

    public void run() {
        try {
            initStreams();
            double a = nextDouble(), vmax = nextDouble(), l = nextDouble(), d = nextDouble(), w = nextDouble();
            if (vmax <= w) {
                double v = Math.sqrt(2 * a * l);
                if (v <= vmax) {
                    out(v / a);
                } else {
                    double s = vmax * vmax / (2 * a);
                    double t = (l - s) / vmax;
                    out(vmax / a + t);
                }
            } else {
                double v = Math.sqrt(a * d + w * w / 2);
                double t1 = 0;
                if (w <= Math.sqrt(2 * a * d)) {
                    if (v <= vmax) {
                        t1 = v / a + (v - w) / a;
                    } else {
                        double s = d - vmax * vmax / (2 * a) - (vmax * vmax - w * w) / (2 * a);
                        t1 = s / vmax + vmax / a + (vmax - w) / a;
                    }
                } else {
                    t1 = Math.sqrt(2 * d / a);
                    w = a * t1;
                }
                v = Math.sqrt(2 * a * (l - d) + w * w);
                double t2 = 0;
                if (v <= vmax) {
                    t2 = (v - w) / a;
                } else {
                    double s = l - d - (vmax * vmax - w * w) / (2 * a);
                    t2 = (vmax - w) / a + s / vmax;
                }
                out(t1 + t2);
            }
        } catch (Throwable e) {
            sError = e;
        } finally {
            pw.flush();
            pw.close();
        }
    }

    private void out(double t) {
        pw.println(t);
    }

}


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class RespectTheRules {
    private static final double E = 1E-10;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double maxV = scanner.nextDouble();
        double l = scanner.nextDouble();
        double d = scanner.nextDouble();
        double w = scanner.nextDouble();

        double r = l - d;
        w = Math.min(w, maxV);

        List<WayPoint> wayPoints = new ArrayList<WayPoint>(256);
        double t = 0;

        wayPoints.add(new WayPoint(0));

        double dW = dTo(w, 0, a);
        if (leq(dW, d)) {
            wayPoints.add(new WayPoint(w));
            {
                double v = v(w, a, (d - dW) / 2);
                v = Math.min(v, maxV);

                wayPoints.add(new WayPoint(v));
                wayPoints.add(new WayPoint(w));

                double dW_V = dTo(v, w, a);
                double vDistance = d - dW - 2 * dW_V;
                if (!eq(vDistance)) {
                    t += vDistance / maxV;
                }
            }
            {
                double dW_MaxV = dTo(maxV, w, a);
                dW_MaxV = Math.min(dW_MaxV, r);
                double v = v(w, a, dW_MaxV);
                wayPoints.add(new WayPoint(v));
                double dMaxV = r - dW_MaxV;
                if (!eq(dMaxV)) {
                    t += dMaxV / maxV;
                }
            }

        } else {
            double dMaxV = dTo(maxV, 0, a);
            dMaxV = Math.min(dMaxV, l);
            double v = v(0, a, dMaxV);
            wayPoints.add(new WayPoint(v));
            double dv = l - dMaxV;
            if (!eq(dMaxV)) {
                t += dv / maxV;
            }
        }

        for (int i = 1; i < wayPoints.size(); ++i) {
            double v0 = wayPoints.get(i - 1).v;
            double v = wayPoints.get(i).v;
            t += Math.abs(tTo(v, v0, a));
        }
        System.out.println(t);
    }

    static double tTo(double v, double v0, double a) {
        return (v - v0) / a;
    }

    static double dTo(double v, double v0, double a) {
        return (v * v - v0 * v0) / (2 * a);
    }

    static double v(double v0, double a, double d) {
        return Math.sqrt(2 * d * a + v0 * v0);
    }

    static boolean eq(double value) {
        return Math.abs(value) <= E;
    }

    static boolean l(double v) {
        return v < -E;
    }

    static boolean leq(double v) {
        return l(v) || eq(v);
    }

    static boolean leq(double one, double another) {
        return leq(one - another);
    }

    static class WayPoint {
        double v;

        WayPoint(double v) {
            this.v = v;
        }
    }
}


import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class Main {
    private static final double EPS = 1e-11;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");

    void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        double a = nextDouble();
        double v = nextDouble();
        double l = nextDouble();
        double d = nextDouble();
        double w = nextDouble();

        double ans = 0.0;

        if (v < w + EPS || sqr(w) / 2 / a > d - EPS) {
            double t1 = sqrt(2 * l / a);
            double t2 = v / a;

            if (t1 < t2 + EPS) {
                ans = t1;
            } else {
                ans = t2 + (l - a * sqr(t2) / 2) / v;
            }
        } else {
            double t1 = v / a;
            double t2 = (v - w) / a;
            double s12 = a * sqr(t1) / 2 + w * t2 + a * sqr(t2) / 2;

            if (s12 < d + EPS) {
                ans += t1 + t2 + (d - s12) / v;
            } else {
                double ta = sqrt(d / a + sqr(w / a) / 2);
                double tb = ta - w / a;
                ans += ta + tb;
            }

            double r = l - d;
            double tm = (v - w) / a;
            double tx = (sqrt(sqr(w) + 2 * a * r) - w) / a;

            if (tx < tm + EPS) {
                ans += tx;
            } else {
                ans += tm + (r - w * tm - a * sqr(tm) / 2) / v;
            }
        }

        out.printf(Locale.US, "%.12f%n", ans);
        out.close();
    }

    double sqr(double x) {
        return x * x;
    }

    String nextToken() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }

        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


import java.util.Scanner;

public class D {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double a = in.nextDouble();
        double v = in.nextDouble();
        double l = in.nextDouble();
        double d = in.nextDouble();
        double w = in.nextDouble();
        double ans = 0;
        double maxSpeedBySign = Math.sqrt(2 * a * d);
        double speedAtSign = -1;
        if (v <= w) {
            if (maxSpeedBySign <= v) {
                ans += Math.sqrt(2 * d / a);
                speedAtSign = maxSpeedBySign;

            } else {
                ans += v / a;
                double distanceLeftTillSign = d - v * v / a / 2;
                ans += distanceLeftTillSign / v;
                speedAtSign = v;
            }
        } else {
            if (maxSpeedBySign <= w) {
                ans += Math.sqrt(2 * d / a);
                speedAtSign = maxSpeedBySign;
            } else {
                double S = d / 2 - w * w / 4 / a;
                double X = d - S;
                double speed = Math.sqrt(2 * a * X);
                if (speed <= v) {
                    ans += Math.sqrt(2 * X / a);
                    ans += (speed - w) / a;
                    speedAtSign = w;
                } else {
                    double distanceToAc = v * v / a / 2;
                    double distanceToDe = (v * v - w * w) / a / 2;
                    ans += Math.sqrt(2 * distanceToAc / a);
                    ans += (d - distanceToAc - distanceToDe) / v;
                    ans += (v - w) / a;
                }
                speedAtSign = w;
            }
        }
        l -= d;
        double timeToGetMaxSpeed = (v - speedAtSign) / a;
        double timeToReachEnd = (-2 * speedAtSign + Math.sqrt(4 * speedAtSign
                * speedAtSign + 8 * a * l))
                / 2 / a;
        if (timeToGetMaxSpeed < timeToReachEnd) {
            ans += timeToGetMaxSpeed;
            double distanceCoveredToMaxSpeed = speedAtSign * timeToGetMaxSpeed
                    + 0.5 * a * timeToGetMaxSpeed * timeToGetMaxSpeed;
            l -= distanceCoveredToMaxSpeed;
            ans += l / v;
        } else {
            ans += timeToReachEnd;
        }
        System.out.println(ans);
    }
}


import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;

public class Main {
	static boolean LOCAL = System.getSecurityManager() == null;
	Scanner sc = new Scanner(System.in);

	void run() {
		double a = sc.nextDouble(), v = sc.nextDouble();
		double L = sc.nextDouble(), d = sc.nextDouble(), w = sc.nextDouble();
		w = min(w, v);
		double t = 0;
		if (w * w / (2 * a) <= d) {
			if ((v * v + 2 * v * (v - w) - (v - w) * (v - w)) / (2 * a) <= d) {
				t = (2 * v - w) / a + (d - (v * v + 2 * v * (v - w) - (v - w) * (v - w)) / (2 * a)) / v;
			} else {
				double A = a, B = w, C = (w * w) / (2 * a) - d;
				t = w / a + (-B + sqrt(max(0, B * B - A * C))) / A * 2;
			}
			if ((2 * w * (v - w) + (v - w) * (v - w)) / (2 * a) <= L - d) {
				t += (v - w) / a + (L - d - (2 * w * (v - w) + (v - w) * (v - w)) / (2 * a)) / v;
			} else {
				double A = a, B = w, C = -2 * (L - d);
				t += (-B + sqrt(max(0, B * B - A * C))) / A;
			}
		} else if (v * v / (2 * a) <= L) {
			t = v / a + (L - (v * v / (2 * a))) / v;
		} else {
			t = sqrt(2 * L / a);
		}
		System.out.printf("%.10f%n", t);
	}

	class Scanner {
		BufferedReader br;
		StringTokenizer st;
		Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			eat("");
		}
		void eat(String s) {
			st = new StringTokenizer(s);
		}
		String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		boolean hasNext() {
			while (!st.hasMoreTokens()) {
				String s = nextLine();
				if (s == null) return false;
				eat(s);
			}
			return true;
		}
		String next() {
			hasNext();
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	void debug(Object...os) {
		System.err.println(deepToString(os));
	}

	public static void main(String[] args) {
		if (LOCAL) {
			try {
				System.setIn(new FileInputStream("in.txt"));
			} catch (Throwable e) {
				LOCAL = false;
			}
		}
		if (!LOCAL) {
			try {
				Locale.setDefault(Locale.US);
				System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
			} catch (Throwable e) {
			}
		}
		new Main().run();
		System.out.flush();
	}
}


import java.io.*;
import java.util.*;

public class D {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	double f(int dist, double initSp, int a, int maxSp) {
		double distToReachMaxSpeed = 0.5 * (maxSp * maxSp - initSp * initSp)
				/ a;

		if (dist > distToReachMaxSpeed)
			return 1d * (maxSp - initSp) / a + (dist - distToReachMaxSpeed)
					/ maxSp;

		return (Math.sqrt(initSp * initSp + 2 * a * dist) - initSp) / a;
	}

	void solve() throws IOException {
		int a = nextInt();
		int maxSp = nextInt();
		int len = nextInt();
		int signX = nextInt();
		int signSp = nextInt();

		if (maxSp <= signSp) {
			out.printf("%.9f\n", f(len, 0, a, maxSp));
			return;
		}

		double distToReachSignSp = 0.5 * signSp * signSp / a;
		if (distToReachSignSp >= signX) {
			double t = Math.sqrt(2d * signX / a);
			out.printf("%.9f\n", t + f(len - signX, t * a, a, maxSp));
			return;
		}

		double distToReachMaxThenSign = 0.5
				* (maxSp * maxSp + maxSp * maxSp - signSp * signSp) / a;
		if (distToReachMaxThenSign <= signX) {
			double t = 1d * (2 * maxSp - signSp) / a
					+ (signX - distToReachMaxThenSign) / maxSp
					+ f(len - signX, signSp, a, maxSp);
			out.printf("%.9f\n", t);
			return;
		}

		double xSp = Math.sqrt(a * signX + signSp * signSp * 0.5);
		double xTime = (2 * xSp - signSp) / a;
		out.printf("%.9f\n", xTime + f(len - signX, signSp, a, maxSp));
	}

	void inp() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new D().inp();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}


import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

public class d {

	double a, v, l, d, w;

	private void solve() throws Exception {
		a = nextInt(); v = nextInt(); l = nextInt(); d = nextInt(); w = nextInt();
		double ans;
		if (w >= v){
			ans = fromSign(0, l);
		}
		else{
			double tToW = w / a;
			double dToW = tToW * tToW * a / 2.;
			if (dToW > d){
				double curT = Math.sqrt(d * 2. / a);
				ans = curT;
				double curV = a * curT;
				ans += fromSign(curV, l - d);
			}
			else{
				double tToMax = v / a;
				double dToMax = tToMax * tToMax * a / 2.;
				double tFromMax = (v - w) / a;
				double dFromMax = tFromMax * v - tFromMax * tFromMax * a / 2.;
				if (dToMax + dFromMax <= d){
					ans = tToMax + tFromMax + (d - dToMax - dFromMax) / v;
				}
				else{
					double lo = w, hi = v;
					for (int i = 0; i < 1000; ++i){
						double mi = (lo + hi) / 2.;
						double tTo = mi / a;
						double dTo = tTo * tTo * a / 2.;
						double tFrom = (mi - w) / a;
						double dFrom = tFrom * mi - tFrom * tFrom * a / 2.;
						if (dTo + dFrom <= d)
							lo = mi;
						else
							hi = mi;
					}
					ans = lo / a + (lo - w) / a;
				}
				ans += fromSign(w, l - d);
			}
		}
		out.printf("%.8f", ans);
	}

	private double fromSign(double curV, double d) {
		double tToMax = (v - curV) / a;
		double dToMax = tToMax * curV + tToMax * tToMax * a / 2.;
		if (dToMax <= d){
			return tToMax + (d - dToMax) / v;
		}
		else{
			double lo = 0, hi = tToMax;
			for (int i = 0; i < 1000; ++i){
				double mi = (lo + hi) / 2.;
				double curD = mi * curV + mi * mi * a / 2.;
				if (curD <= d)
					lo = mi;
				else
					hi = mi;
			}
			return lo;
		}
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			NOO(e);
		} finally {
			out.close();
		}
	}

	PrintWriter out;
	BufferedReader in;
	StringTokenizer St;

	void NOO(Exception e) {
		e.printStackTrace();
		System.exit(1);
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	String nextToken() {
		while (!St.hasMoreTokens()) {
			try {
				String line = in.readLine();
				St = new StringTokenizer(line);
			} catch (Exception e) {
				NOO(e);
			}
		}
		return St.nextToken();
	}

	private d(String name) {
		try {
			in = new BufferedReader(new FileReader(name + ".in"));
			St = new StringTokenizer("");
			out = new PrintWriter(new FileWriter(name + ".out"));
		} catch (Exception e) {
			NOO(e);
		}
	}

	private d() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			St = new StringTokenizer("");
			out = new PrintWriter(System.out);
		} catch (Exception e) {
			NOO(e);
		}
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		new d(/*"d"*/).run();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Stack;

public class ProblemD {
	public static void main(String[] args) throws IOException {
		BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] data = s.readLine().split(" ");
		double a = Double.valueOf(data[0]);
		double v = Double.valueOf(data[1]);

		String[] line = s.readLine().split(" ");
		double l = Double.valueOf(line[0]);
		double d = Double.valueOf(line[1]);
		double w = Double.valueOf(line[2]);

		double ans = solve(a, v, l, d, w);
		out.println(String.format("%.07f", ans));

		out.flush();
	}

	private static double solve(double a, double v, double l, double d, double w) {
		double maxSpeedAtD = Math.sqrt(2 * d / a) * a;
		if (v <= w || maxSpeedAtD <= w) {
			// okay. just go
			double maxSpeedAtL = Math.sqrt(2 * l / a) *  a;
			if (maxSpeedAtL <= v) {
				return Math.sqrt(2 * l / a);
			} else {
				double timeToMaxSpeed = v / a;
				double leftDist = l - 0.5 * a * timeToMaxSpeed * timeToMaxSpeed;
				return timeToMaxSpeed + leftDist / v;
			}
		}

		double time = 0.0d;
		double maxSpeedTime = Math.sqrt((d / a) + (w * w / (2 * a * a)));
		double maxSpeed = maxSpeedTime * a;
		if (maxSpeed <= v) {
			time = maxSpeedTime + (a * maxSpeedTime - w) / a;
		} else {
			double vtime = (2 * a * d + w * w - 2 * v * v) / (2 * a * v);
			time = v / a + vtime + (v - w) / a;
		}

		// after that, just go.
		double timeToV = (v - w) / a;
		double timeToVLen = timeToV * w + 0.5 * timeToV * (v - w);
		if (timeToVLen <= l - d) {
			double leftLen = l - d - timeToVLen;
			time += timeToV + leftLen / v;
		} else {
			time += (-w + Math.sqrt(w*w + a * (2 * l - 2 * d))) / a;
		}
		return time;
	}

	public static void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}
}


import java.io.*;
import java.util.*;

public class Solution {

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	void solve() throws IOException {
		double a = nextDouble();
		double v = nextDouble();
		double l = nextDouble();
		double d = nextDouble();
		double w = nextDouble();
		if (w > v) {
			w = v;
		}
		double ans1 = 0.;
		double v1;
		{
			double l_ = 0., r_ = 1e+9;
			for (int it = 0; it < 100; ++it) {
				double mid = (l_ + r_) / 2.;
				double V = a * mid;
				double t1 = (V + w) / 2. / a;
				double t2 = mid - t1;
				t1 = Math.min(t1, v / a);
				t2 = Math.min(t2, (v - w) / a);
				if (V < w) {
					t1 = mid;
					t2 = 0.;
				}
				double dist = t1 * t1 * a / 2. + t2 * (w + t2 * a / 2.) + v * (mid - t1 - t2);
				if (dist < d) {
					l_ = mid;
				} else {
					r_ = mid;
				}
			}
			ans1 = (l_ + r_) / 2.;
			v1 = Math.min(ans1 * a, w);
		}
		double ans2 = 0.;
		{
			double tSp = (v - v1)  / a;
			double l_ = 0., r_ = 1e+9;
			for (int it = 0; it < 100; ++it) {
				double mid = (l_ + r_) / 2.;
				double dist = Math.min(tSp, mid) * (v1 + Math.min(tSp, mid) * a / 2.);
				dist += (mid - Math.min(tSp, mid)) * v;
				if (dist < l - d) {
					l_ = mid;
				} else {
					r_ = mid;
				}
			}
			ans2 = (l_ + r_) / 2.;
		}
		out.println(ans1 + ans2);
	}

	Solution() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		eat("");

		solve();

		in.close();
		out.close();
	}

	private void eat(String str) {
		st = new StringTokenizer(str);
	}

	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) throws IOException {
		new Solution();
	}
}


import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {

	void solve() {
		double a = sc.nextDouble();
		double v = sc.nextDouble();
		double l = sc.nextDouble();
		double d = sc.nextDouble();
		double w = sc.nextDouble();

		double res = calc(a, v, l, d, w);
		out.printf("%.10f\n", res);

	}

	double calc(double a, double v, double l, double d, double w) {
		if (v <= w) return getTime(a, 0, l, v);

		// 距離 d までに速度 w に達しない場合
		if ((w * w) >= d * 2 * a) return getTime(a, 0, l, v);

		// それ以外は、d は速度wで通過
		double ans = 0;

		double[] r1 = getReach(a, 0, v);
		double[] r2 = getReach(a, w, v);

		// d までに最高速度 v に達する場合
		if (r1[1] + r2[1] <= d) {
			ans += r1[0];
			ans += r2[0];
			ans += (d - r1[1] - r2[1]) / v;
		} else {
			// d までに最高速度に達しない場合
			double t0 = sqrt((2 * a * d + w * w) / (2 * a * a));
			ans += t0 + (a * t0 - w) / a;
		}

		ans += getTime(a, w, l - d, v);
		return ans;

	}

	/**
	 *  s から v に達するまでの時間と、その間の走行距離
	 */
	double[] getReach(double a, double s, double v) {
		double t = (v - s) / a;
		double dist = t * (v + s) / 2.0;
		return new double[]{t, dist};
	}

	/**
	 * 初速 s、加速a、 最高速度 v で距離 l を走るのにかかる時間
	 */
	double getTime(double a, double s, double l, double v) {
		double t = (-s + sqrt(s * s + 2 * a * l)) / a;
		double t_ = (v - s) / a;
		if (t < t_) return t;

		double p = l - (s + v) * t_ / 2;
		return t_ + (p / v);
	}

	public static void main(String[] args) throws Exception {
		Class<?> here = new Object(){}.getClass().getEnclosingClass();
		try {
			String packageName = here.getPackage().getName();
			packageName = "src/" + packageName.replaceAll("\\.", "/") + "/";
			System.setIn(new FileInputStream(packageName + "input.txt"));
//			System.setOut(new PrintStream(new FileOutputStream(packageName + "output.txt")));
		} catch (FileNotFoundException e) {
		} catch (NullPointerException e) {
		}

		Object o = Class.forName(here.getName()).newInstance();
		o.getClass().getMethod("run").invoke(o);
	}

	static void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	MyScanner sc = null;
	PrintWriter out = null;
	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		for (;sc.hasNext();) {
			solve();
			out.flush();
		}
		out.close();
	}

	void print(int[] a) {
		out.print(a[0]);
		for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
		out.println();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}
		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}
		public String next() {
			eat();
			return tokenizer.nextToken();
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
	}
}


import java.util.*;
import java.io.*;

public class Main {

    static final double EPS = 1E-6;
    double a, v, l, d, w, u;

    public void run() {
        a = cin.nextDouble();
        v = cin.nextDouble();
        l = cin.nextDouble();
        d = cin.nextDouble();
        w = cin.nextDouble();
        w = Math.min(w, v);
        double s1 = v * v / (2 * a);
        double s2 = w * w / (2 * a);
        double s3 = s1 - s2;

        double cost = 0;
        if (d < s2) {
            cost += Math.sqrt(2 * d / a);
            w = cost * a;
        } else if (d < s1 + s3) {
            u = Math.sqrt(d / a + w * w / (2 * a * a)) * a;
            cost = u / a + (u - w) / a;
        } else {
            cost += v / a;
            cost += (v - w) / a;
            cost += (d - s3 - s1) / v;
        }
        d = l - d;
        s3 = (v * v - w * w) / (2 * a);
        if (d < s3) {
            cost += (-w + Math.sqrt(w * w + 2 * a * d)) / a;
        } else {
            cost += (v - w) / a;
            cost += (d - s3) / v;
        }
        out.println(cost);
    }

    public static void main(String[] args) throws IOException {
        Main sloved = new Main();
        sloved.run();
        sloved.out.close();
    }

    Scanner cin = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
}


import java.util.*;
import static java.lang.Math.*;

public final class FollowTrafficRules {
    private static double[] acce(double i, double a, double v) {
        double[] r = new double[2];
        r[0] = (v - i)/a;
        r[1] = 1d/2d * a * pow(r[0], 2) + i * r[0];
        return r;
    }

    private static double solve(double i, double a, double l) {
        double e = sqrt(pow(i, 2) + 2d * a * l);
        e = a > 0 ? e : -1d * e;
        return (e - i)/a;
    }

    private static double time(double i, double a, double v, double l) {
        double[] r = acce(i, a, v);
        if (r[1] >= l) return solve(i, a, l);
        return r[0] + (l - r[1])/v;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double v = sc.nextDouble();
        double l = sc.nextDouble();
        double d = sc.nextDouble();
        double w = sc.nextDouble();

        double t = 0d;
        if (v <= w) t = time(0, a, v, l);
        else {
            double[] r = acce(0, a, w);
            if (r[1] >= d) t = time(0, a, v, l);
            else {
                t += r[0];
                t += 2d * time(w, a, v, (d - r[1])/2d);
                t += time(w, a, v, l - d);
            }
        }

        System.out.println(t);
    }
}


import java.io.*;
import java.util.*;

public class D implements Runnable {
	public static void main(String[] args) {
		new Thread(new D()).start();
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	static final double EPS = 1e-9;

	static double qEq(double a, double b, double c) {
		double d = b * b - 4 * a * c;
		if (d < -EPS) {
			return Double.NaN;
		}
		return Math.max((-b + Math.sqrt(d)) / (2 * a), (-b - Math.sqrt(d))
				/ (2 * a));
	}

	static int compare(double a, double b) {
		return Math.abs(a - b) < EPS ? 0 : Double.compare(a, b);
	}

	void solve() {
		double a = nextDouble();
		double v = nextDouble();
		double l = nextDouble();
		double d = nextDouble();
		double w = nextDouble();
		if (compare(w, v) >= 0) {
			double t1 = v / a;
			double d1 = a * t1 * t1 * .5;
			if (compare(d1, l) >= 0) {
				out.println(Math.sqrt(2 * l / a));
			} else {
				out.println(t1 + (l - d1) / v);
			}
			return;
		}
		double t1 = w / a;
		double d1 = a * t1 * t1 * .5;
		if (compare(d1, d) >= 0) {
			double t2 = v / a;
			double d2 = a * t2 * t2 * .5;
			if (compare(d2, l) >= 0) {
				out.println(Math.sqrt(2 * l / a));
			} else {
				out.println(t2 + (l - d2) / v);
			}
			return;
		}
		double left = d - d1;
		double timeToV = (v - w) / a;
		double distToV = a * timeToV * timeToV * .5 + w * timeToV;
		// System.err.println(t1 + " " + left + " " + timeToV + " " + distToV
		// + " " + d1);
		if (compare(distToV, left * .5) >= 0) {
			double t2 = qEq(a * .5, w, -left * .5);
			// System.err.println(t2 + " " + (a * t2 * t2 * .5 + w * t2));
			t2 += t1 + t2;
			if (compare(distToV, l - d) >= 0) {
				out.println(t2 + qEq(a * .5, w, d - l));
			} else {
				out.println(t2 + timeToV + (l - d - distToV) / v);
			}
			return;
		}
		double t2 = t1 + 2 * timeToV + (left - 2 * distToV) / v;
		if (compare(distToV, l - d) >= 0) {
			out.println(t2 + qEq(a * .5, w, d - l));
		} else {
			out.println(t2 + timeToV + (l - d - distToV) / v);
		}
	}
}


import java.io.*;
import java.util.*;
import java.text.*;

public class FollowTrafficRules
{
	public Scanner in = new Scanner(System.in);
	public PrintStream out = System.out;

	public double len, d, w, vmax, a;

	DecimalFormat fmt = new DecimalFormat("0.0000000000000000");

	public void main()
	{
		a = in.nextDouble();
		vmax = in.nextDouble();
		len = in.nextDouble();
		d = in.nextDouble();
		w = in.nextDouble();

		out.println(fmt.format(T()));
	}//end public void main()

	public double T()
	{
		double t, s;

		double t1, s1;
		t1 = vmax / a;
		s1 = vmax*vmax/(2.0*a);

		double t3, s3;
		t3 = w/a;
		s3 = w*w/(2.0*a);

		if(w >= vmax)
		{
			if(s1 < len)
			{
				return t1 + (len - s1)/vmax;
			}
			else
			{
				return Math.sqrt(2.0*len/a);
			}
		}
		else
		{
			//w < vmax

			double t2, s2, v2;
			t2 = Math.sqrt(2.0*d/a);
			v2 = a*t2;

			double tx, vx;
			vx = Math.sqrt((2.0*a*d + w*w)/2.0);
			tx = vx / a;

			//vmax > w

			//v2 > vx > w

			if(v2 < w)
			{
				if(v2 > vmax)
				{
					//v2 > vmax > w
					if(vmax > vx)
					{
						return tx + (vx - w)/a + T2(w);
					}
					else
					{
						double ty, sy;
						ty = (vmax - w)/a;
						sy = ty * (vmax + w)/2.0;
						return t1 + ty + (d - s1 - sy)/vmax + T2(w);
					}
				}
				else
				{
					//v2 < w, v2 <= vmax
					return t2 + T2(v2);
				}
			}
			else if(v2 > vmax) //v2 >= w, vmax > w
			{
				//v2 > vmax > w
				if(vmax > vx)
				{
					return tx + (vx - w)/a + T2(w);
				}
				else
				{
					double ty, sy;
					ty = (vmax - w)/a;
					sy = ty * (vmax + w)/2.0;
					return t1 + ty + (d - s1 - sy)/vmax + T2(w);
				}
			}
			else  //vmax >= v2 >= w
			{
				//out.println("Questionable.");
				//return binary() + T2(w);

				//return  t3 + (d-s3)/w + T2(w);

				return tx + (vx - w)/a + T2(w);
			}
		}
	}

	public double binary()
	{
		double low, high, t, s;
		low = 0.0; high = vmax/a;

		for(int c=0;c<50;++c)
		{
			t = (low+high)/2;
			s = (a*t*t)/2 + ((a*t - w)/a)*(a*t + w)/2.0;

			if(s > d) high = t;
			else low = t;
		}
		t = (low+high)/2;
		return t + (a*t - w)/a;
	}

/*
	public double T()
	{
		double t1, s1, tx, sx, vx, ty, vy, sz, tz;
		t1 = vmax / a;
		s1 = a*t1*t1 / 2.0;

		vx = Math.sqrt((2.0*a*d + w*w)/2.0);
		tx = vx / a;

		if(s1 < d)
		{
			//reaches vmax
			if(vx < vmax)
			{
				//stops at vx
				return tx + (vx - w)/a + T2(w);
			}
			else //vx >= vmax
			{
				//stops at vmax
				if(w > vmax)
				{
					return t1 + (d - s1)/vmax + T2(vmax);
				}
				else
				{
					tz = (vmax - w)/a;
					sz = ((vmax + w)/2.0) * tz;

					return t1 + (d-sz-s1)/vmax + tz + T2(w);
				}
			}
		}
		else //s1 >= d
		{
			//never reaches vmax
			vy = Math.sqrt(2.0*d*a);
			ty = vy / a;
			if(vx < vy)
			{
				//stops at vx
				return tx + (vx - w)/a + T2(w);
			}
			else //vx >= vy
			{
				if(w < vy)
				{
					return w/a + (d - w*w/(2.0*a))/w + T2(w);
				}
				else //w >= vy
				{
					//goes to vy, accelerate all the way
					return ty + T2(vy);
				}
			}
		}
	}
*/
	public double T2(double v0)
	{
		//v0 <= min(w, vmax)

		double t1, s1;
		t1 = (vmax - v0)/a;
		s1 = ((vmax + v0)/2.0)*t1;

		if(s1 < len-d)
		{
			//reaches vmax
			return t1 + (len-d-s1)/vmax;
		}
		else //s1 >= len - d
		{
			//does not reach vmax
			return (-v0 + Math.sqrt(v0*v0 + 2*a*(len-d)))/a;
		}
	}

	public static void main(String[] args)
	{
		(new FollowTrafficRules()).main();
	}
}


import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;

public class Main implements Runnable {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Thread(new Main()).start();
	}

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			run1();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}

	int nextInt(StreamTokenizer st) throws IOException {
		st.nextToken();
		return (int) st.nval;
	}

	double nextDouble(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.nval;
	}

	String nextLine(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.sval;
	}

	Map<String, BigInteger> map = new HashMap<String, BigInteger>();

	public void run1() throws IOException {
		Locale.setDefault(Locale.US);
		// long time = -System.currentTimeMillis();
		 Scanner sc = new Scanner(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(System.in));
//		Scanner sc = new Scanner(new File("input.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("input.txt"));
		// PrintStream ps = System.out;// new PrintStream(new
		// File("output.txt"));
		// gopa(br, ps);
		double a = sc.nextDouble();
		double vmax = sc.nextDouble();
		double l2 = sc.nextDouble();
		double l1 = sc.nextDouble();
		l2 -= l1;
		double boundv = sc.nextDouble();
		if (boundv >= vmax || boundv * boundv / a / 2 > l1) {
			System.out.print(get(0, a, vmax, l1 + l2));
			System.exit(0);
		}
		double tmplen = vmax * vmax / a / 2 + (vmax + boundv) / 2
				* (vmax - boundv) / a;
		if (tmplen < l1) {
			System.out.print(get(boundv, a, vmax, l2) + vmax
					/ a + (vmax - boundv) / a + (l1 - tmplen) / vmax);
			System.exit(0);
		}
		double v = Math.sqrt(l1 * a + boundv * boundv / 2);
		System.out.print(get(boundv, a, vmax, l2) + v / a
				+ (v - boundv) / a);
	}

	double get(double v0, double a, double vmax, double l) {
		double tmplen = (vmax + v0) / 2 * (vmax - v0) / a;
		// System.out.println(tmplen);
		if (l >= tmplen) {
			return (vmax - v0) / a + (l - tmplen) / vmax;
		}
		return (-v0 + Math.sqrt(v0 * v0 + 2 * a * l)) / a;
	}
}