#include <bits/stdc++.h>
using namespace std;
double Convert(double degree) {
  double pi = 3.14159265359;
  return (degree * (pi / 180));
}
int main() {
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double deg, rad, res;
  if (m == 0) m = 60;
  h = h * 5;
  deg = abs(h - m) * (90 / 15);
  rad = Convert(deg);
  res = float(b / sin(rad));
  cout << setprecision(21) << res;
}
