#include <bits/stdc++.h>
using namespace std;
int s, st, ed, t1, t2, p, d;
int main() {
  scanf("%d%d%d%d%d%d%d", &s, &st, &ed, &t1, &t2, &p, &d);
  int ans1 = abs(st - ed) * t2, ans2;
  if (t2 <= t1) {
    cout << ans1 << endl;
  } else {
    int o = ed - st;
    if (o > 0 && d == 1) {
      if (p <= st) {
        ans2 = (ed - p) * t1;
      } else {
        ans2 = (s + s - p + ed) * t1;
      }
      cout << min(ans1, ans2) << endl;
    } else if (o > 0 && d == -1) {
      ans2 = (p + ed) * t1;
      cout << min(ans1, ans2) << endl;
    } else if (o < 0 && d == 1) {
      ans2 = (s - p + s - ed) * t1;
      cout << min(ans1, ans2) << endl;
    } else if (o < 0 && d == -1) {
      if (p >= st) {
        ans2 = (p - ed) * t1;
      } else {
        ans2 = (s + s + p + -ed) * t1;
      }
      cout << min(ans1, ans2) << endl;
    } else
      cout << 0 << endl;
  }
  return 0;
}
