#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  vector<string> room(n);
  for (int i = (0); i < ((n)); ++i) cin >> room[n - i - 1];
  int cf = n - 1, p = 0, next = 0, prev = 0, dir = 1;
  int nswaps = 0;
  long long t = 0;
  while (cf > 0) {
    if (nswaps > m + 1) {
      cout << "Never" << endl;
      return 0;
    }
    ++t;
    if (room[cf - 1][p] == '.') {
      --cf;
      next = prev = p;
      nswaps = 0;
      continue;
    }
    if (p + dir == m || p + dir == -1) {
      dir *= -1;
      swap(next, prev);
      ++nswaps;
      continue;
    }
    if (next == p) {
      if (room[cf][p + dir] == '.') {
        p += dir;
        next = p;
      } else if (room[cf][p + dir] == '+') {
        room[cf][p + dir] = '.';
        next = p + dir;
        dir *= -1;
        swap(next, prev);
        continue;
      } else {
        dir *= -1;
        swap(next, prev);
        ++nswaps;
        continue;
      }
    } else {
      t += abs(p - next) - 1;
      p = next;
      continue;
    }
  }
  cout << t << endl;
  return 0;
}
