#include <bits/stdc++.h>
using namespace std;
template <typename T>
T next_int() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return p * x;
}
string next_token() {
  char ch;
  string ans = "";
  do {
    ch = getchar();
  } while (ch <= ' ');
  while (ch > ' ') {
    ans += ch;
    ch = getchar();
  }
  return ans;
}
const long long INF = (long long)1e18 + 227 + 1;
const int INFINT = (int)1e9 + 227 + 1;
const int MAXN = (int)2e5 + 227 + 1;
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;
long long bin_pow(long long a, long long b, long long MOD) {
  if (!b) return 1;
  long long ans = bin_pow(a, b / 2, MOD);
  ans = ans * ans % MOD;
  if (b % 2) ans = ans * a % MOD;
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = next_token();
    a[i] = '#' + a[i];
    a[i] += '#';
  }
  long long ans = 0;
  int na = 0;
  int p = 1;
  for (int i = 0; i + 1 < n; i++) {
    set<pair<int, int> > b;
    for (int j = 0; j < a[i].size(); j++) {
      int kek = 0;
      if (a[i][j] == '+') kek += 1;
      if (a[i][j] == '#') kek += 2;
      if (a[i + 1][j] == '.') kek += 4;
      if (kek) b.insert(make_pair(j, kek));
    }
    bool ok = 0;
    for (int it = 0; it < m * 2; it++) {
      if (na == 0) {
        set<pair<int, int> >::iterator i = b.lower_bound(make_pair(p, 0));
        if (i == b.end()) {
          ans += abs(p - m);
          p = m;
        } else {
          int type = (*i).second;
          int po = (*i).first;
          if (type & 2) {
            ans += abs((po - 1) - p);
            ans++;
            p = po - 1;
          } else if (type & 1) {
            type ^= 1;
            ans += abs((po - 1) - p);
            ans++;
            p = po - 1;
          } else if (type & 4) {
            type ^= 4;
            ans += abs(po - p);
            ans++;
            p = po;
            ok = 1;
            break;
          }
          b.erase(i);
          if (type) b.insert(make_pair(po, type));
        }
        na = 1;
      } else {
        set<pair<int, int> >::iterator i = b.lower_bound(make_pair(p + 1, 0));
        if (i == b.begin()) {
          ans += p - 1;
          p = 1;
        } else {
          i--;
          int type = (*i).second;
          int po = (*i).first;
          if (type & 2) {
            ans += abs((po + 1) - p);
            ans++;
            p = po + 1;
          } else if (type & 1) {
            type ^= 1;
            ans += abs((po + 1) - p);
            ans++;
            p = po + 1;
          } else if (type & 4) {
            type ^= 4;
            ans += abs(po - p);
            ans++;
            p = po;
            ok = 1;
            break;
          }
          b.erase(i);
          if (type) b.insert(make_pair(po, type));
        }
        na = 0;
      }
    }
    if (!ok) {
      puts("Never");
      return 0;
    }
  }
  cout << ans << "\n";
}
