#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, x1, x2, t1, t2, p, d;
  cin >> s >> x1 >> x2 >> t1 >> t2 >> p >> d;
  int walking = abs(x1 - x2) * t2;
  int other = 0;
  if (d > 0) {
    if (x1 >= p) {
      other = other + x1 - p;
      if (x2 > x1)
        other = other + x2 - x1;
      else
        other = other + 2 * s - x2 - x1;
    } else {
      other = other + 2 * s - p - x1;
      if (x1 > x2)
        other = other + x1 - x2;
      else
        other = other + x1 + x2;
    }
  } else {
    if (x1 <= p) {
      other = other - x1 + p;
      if (x2 < x1)
        other = other - x2 + x1;
      else
        other = other + x2 + x1;
    } else {
      other = other + p + x1;
      if (x1 < x2)
        other = other + x2 - x1;
      else
        other = other + 2 * s - x1 - x2;
    }
  }
  cout << min(walking, other * t1) << endl;
}
