#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int M = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int s, x1, x2, t1, t2, p, d;
  cin >> s >> x1 >> x2;
  cin >> t1 >> t2;
  cin >> p >> d;
  int ans = t2 * abs(x1 - x2);
  if (x1 < x2) {
    if (d == -1)
      ans = min(ans, (p + x2) * t1);
    else if (p <= x1)
      ans = min(ans, (x2 - p) * t1);
    else
      ans = min(ans, (s + s - p + x2) * t1);
  } else {
    if (d == 1)
      ans = min(ans, (s + s - p - x2) * t1);
    else if (p >= x1)
      ans = min(ans, (p - x2) * t1);
    else
      ans = min(ans, (s + p + s - x2) * t1);
  }
  cout << ans << "\n";
  return 0;
}
