#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
const int maxm = 1e9 + 10;
const int inf = 0x3f3f3f3f;
int main() {
  int s, x1, x2, t1, t2, d, p;
  scanf("%d %d %d", &s, &x1, &x2);
  scanf("%d %d", &t1, &t2);
  scanf("%d %d", &p, &d);
  int ans1, ans2;
  ans1 = abs(x1 - x2) * t2;
  if (d == 1) {
    if (p <= x1 && x2 > x1)
      ans2 = (x2 - p) * t1;
    else if (x2 > x1)
      ans2 = (s - p + s + x2) * t1;
    else if (x2 < x1)
      ans2 = (s - p + s - x2) * t1;
  } else {
    if (p >= x1 && x2 < x1)
      ans2 = (p - x2) * t1;
    else if (x2 < x1)
      ans2 = (p + s + s - x2) * t1;
    else if (x2 > x1)
      ans2 = (p + x2) * t1;
  }
  printf("%d\n", min(ans1, ans2));
}
