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