#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, x1, x2, t1, t2, p, d, ans1, ans2, len;
  while (~scanf("%d%d%d%d%d%d%d", &s, &x1, &x2, &t1, &t2, &p, &d)) {
    if (t2 <= t1) {
      printf("%d\n", abs(x1 - x2) * t2);
      continue;
    }
    ans1 = abs(x1 - x2) * t2;
    if (x1 < x2) {
      if (p <= x1) {
        if (d == 1)
          len = x2 - p;
        else
          len = p + x2;
      } else {
        if (d == 1)
          len = s - p + s + x2;
        else
          len = p + x2;
      }
    } else {
      if (p >= x1) {
        if (d == 1)
          len = s - x2 + s - p;
        else
          len = p - x2;
      } else {
        if (d == 1)
          len = s - p + s - x2;
        else
          len = p + s + s - x2;
      }
    }
    ans2 = len * t1;
    printf("%d\n", min(ans1, ans2));
  }
  return 0;
}
