#include <bits/stdc++.h>
template <typename T>
T inline SQR(const T &a) {
  return a * a;
}
template <typename T>
T inline ABS(const T &a) {
  return a < 0 ? -a : a;
}
const double EPS = 1e-9;
inline int SGN(double a) {
  return ((a > EPS) ? (1) : ((a < -EPS) ? (-1) : (0)));
}
inline int CMP(double a, double b) { return SGN(a - b); }
using namespace std;
string grid[128];
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> grid[i];
    grid[i] = "#" + grid[i] + "#";
  }
  long long res = 0;
  int i = 0;
  int dir = 1;
  int l = 1, r = 1, cur = 1;
  bool looped = false;
  while (i != n - 1) {
    l = min(l, cur);
    r = max(r, cur);
    if (grid[i + 1][cur] == '.') {
      res++;
      i++;
      l = cur, r = cur;
      looped = false;
      continue;
    }
    if (dir)
      cur++;
    else
      cur--;
    res++;
    if (grid[i][cur] == '+') {
      grid[i][cur] = '.';
      l = min(l, cur);
      r = max(r, cur);
      dir = !dir;
      if (dir)
        cur++;
      else
        cur--;
      looped = false;
    } else if (grid[i][cur] == '#') {
      if (looped) {
        cout << "Never\n";
        return 0;
      } else
        looped = true;
      dir = !dir;
      if (dir)
        cur++;
      else
        cur--;
    } else {
      looped = false;
      continue;
    }
    if (dir) {
      res += (r - cur);
      cur = r;
    } else {
      res += (cur - l);
      cur = l;
    }
  }
  cout << res << "\n";
  return 0;
}
